Permalink
Browse files

Merge pull request #4741 from pacoguzman/initialize_variable_not_needed

Remove initialize variable columnn, not needed
  • Loading branch information...
2 parents d5ddc6c + 2a8f34a commit 786a0195cb76f96a29896467969044f222597ae4 @spastorino spastorino committed Jan 29, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 activerecord/lib/active_record/validations/uniqueness.rb
@@ -57,8 +57,7 @@ def find_finder_class_for(record) #:nodoc:
def build_relation(klass, table, attribute, value) #:nodoc:
reflection = klass.reflect_on_association(attribute)
- column = nil
- if(reflection)
+ if reflection
column = klass.columns_hash[reflection.foreign_key]
attribute = reflection.foreign_key
value = value.attributes[reflection.primary_key_column.name]

0 comments on commit 786a019

Please sign in to comment.