Permalink
Browse files

No need for parenthesis here

  • Loading branch information...
1 parent f527f90 commit 67df21f8954073ddc7f3409ec618c953f97cb412 @spastorino spastorino committed Oct 17, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/attribute_methods/read.rb
@@ -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)

3 comments on commit 67df21f

Member

jonleighton replied Oct 17, 2010

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...

Contributor

dallas replied Oct 18, 2010

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

Contributor

knoopx replied Oct 18, 2010

I hate useless characters, software patents and Justin Bieber

Please sign in to comment.