Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't define DISALLOWED_SUFFIXES if already defined #17125

Merged
merged 1 commit into from
Mar 13, 2018
Merged

Don't define DISALLOWED_SUFFIXES if already defined #17125

merged 1 commit into from
Mar 13, 2018

Conversation

djberg96
Copy link
Contributor

@djberg96 djberg96 commented Mar 9, 2018

Prevents this warning while running specs, and might be good in general:

/app/models/metering.rb:5: warning: already initialized constant Metering::DISALLOWED_SUFFIXES

@miq-bot miq-bot added the wip label Mar 9, 2018
@Fryguy
Copy link
Member

Fryguy commented Mar 10, 2018

As mentioned in Gitter, can you just put the constant in the module itself?

[1] pry(main)> require 'active_support/all'
=> true
[2] pry(main)> module ModA; extend ActiveSupport::Concern; CONSTANT=[1,2,3]; end
=> [1, 2, 3]
[3] pry(main)> class ClassA; include ModA; end
=> ClassA
[4] pry(main)> ClassA::CONSTANT
=> [1, 2, 3]

@djberg96
Copy link
Contributor Author

@Fryguy ok, updated to to just define it normally.

@miq-bot
Copy link
Member

miq-bot commented Mar 13, 2018

Checked commit https://github.com/djberg96/manageiq/commit/85a757e894bddba5c03f205635297d222ad209fb with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🍪

@chrisarcand chrisarcand merged commit e63d3ce into ManageIQ:master Mar 13, 2018
@chrisarcand chrisarcand self-assigned this Mar 13, 2018
@chrisarcand chrisarcand added this to the Sprint 82 Ending Mar 26, 2018 milestone Mar 13, 2018
@chrisarcand chrisarcand removed the wip label Mar 13, 2018
@chrisarcand chrisarcand changed the title [WIP] Don't define DISALLOWED_SUFFIXES if already defined Don't define DISALLOWED_SUFFIXES if already defined Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants