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
Code style refactor #1546
Code style refactor #1546
Conversation
@@ -5,7 +5,7 @@ def initialize(html, table_css_selector = "table") | |||
end | |||
|
|||
def to_array | |||
rows = Nokogiri::HTML(@html).css("#{@selector} tr") | |||
rows = Nokogiri::HTML(@html).css("#@selector tr") |
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.
Not many people know the conditions under which braces can be omitted. It's clearer to leave the {} in. Most projects do.
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.
Ok. Agree.
@@ -17,7 +17,7 @@ def filter(method, options = {}) | |||
|
|||
# Returns the default filter type for a given attribute | |||
def default_input_type(method, options = {}) | |||
if column = column_for(method) | |||
if (column = column_for(method)) |
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.
I don't usually do this. I guess it's a matter of taste? :)
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.
Maybe :) Everyone follows his style. But Github recommends doing so https://github.com/styleguide/ruby/. In this particular case may be obvious whether a value is assigned to a variable or two variables are compared. You decide.
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.
GitHub FTW!
No description provided.