Skip to content

Commit

Permalink
No need for parenthesis here
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Oct 17, 2010
1 parent f527f90 commit 67df21f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/attribute_methods/read.rb
Expand Up @@ -85,7 +85,7 @@ def read_attribute(attr_name)
def _read_attribute(attr_name)
attr_name = attr_name.to_s
attr_name = self.class.primary_key if attr_name == 'id'
if (value = @attributes[attr_name])
if value = @attributes[attr_name]
if column = column_for_attribute(attr_name)
if unserializable_attribute?(attr_name, column)
unserialize_attribute(attr_name)
Expand Down

3 comments on commit 67df21f

@jonleighton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some people prefer parens in this situation to signify that it is assignment rather than comparison.

Personally I hate assignment in a conditional test and would avoid it like the plague...

@dallas
Copy link
Contributor

@dallas dallas commented on 67df21f Oct 18, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some people prefer using actual English words like "parentheses" instead of "parens"—the world is just a big ball of preferences.

@knoopx
Copy link
Contributor

@knoopx knoopx commented on 67df21f Oct 18, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate useless characters, software patents and Justin Bieber

Please sign in to comment.