-
Notifications
You must be signed in to change notification settings - Fork 353
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
do not alias rich text area if it is not defined #709
Changes from 4 commits
c2d4a1d
45c0af3
061420c
f1f02ca
dbc7e18
e77c68c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,9 @@ Layout/LineLength: | |
Layout/SpaceAroundEqualsInParameterDefault: | ||
EnforcedStyle: no_space | ||
|
||
Lint/SuppressedException: | ||
Enabled: false | ||
|
||
Metrics/AbcSize: | ||
Max: 18 | ||
Exclude: | ||
|
@@ -45,6 +48,7 @@ Metrics/AbcSize: | |
|
||
Metrics/BlockLength: | ||
Exclude: | ||
- "lib/bootstrap_form/inputs/base.rb" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we can leave this one in here, since it applies to the whole file anyway. But I should look at the rule and where it came from. I'm a fan of RuboCop, but not of these rules that put arbitrary limits on the size of things. |
||
- "demo/config/**/*" | ||
- "demo/test/**/*" | ||
- "test/**/*" | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -31,9 +31,16 @@ def bootstrap_select_group(field_name) | |||||
bootstrap_alias field_name | ||||||
end | ||||||
|
||||||
# Creates the methods *_without_bootstrap and *_with_bootstrap. | ||||||
# | ||||||
# If your application did not include the rails gem for one of the dsl | ||||||
# methods, then a name error is raised and suppressed. This can happen | ||||||
# if your application does not include the actiontext dependency due to | ||||||
# `rich_text_area` not being defined. | ||||||
def bootstrap_alias(field_name) | ||||||
alias_method "#{field_name}_without_bootstrap".to_sym, field_name | ||||||
alias_method field_name, "#{field_name}_with_bootstrap".to_sym | ||||||
rescue NameError | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer to do the RuboCop exception specifically on the line.
Suggested change
|
||||||
end | ||||||
end | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below.