Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

No need for parenthesis here

  • Loading branch information...
commit 67df21f8954073ddc7f3409ec618c953f97cb412 1 parent f527f90
@spastorino spastorino authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  activerecord/lib/active_record/attribute_methods/read.rb
View
2  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

@jonleighton
Collaborator

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

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

@knoopx

I hate useless characters, software patents and Justin Bieber

Please sign in to comment.
Something went wrong with that request. Please try again.