aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/validations
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-01-29 07:24:39 -0800
committerSantiago Pastorino <santiago@wyeworks.com>2012-01-29 07:24:39 -0800
commit786a0195cb76f96a29896467969044f222597ae4 (patch)
treeebdc0f823a71a33bfb075107b82813121711fb45 /activerecord/lib/active_record/validations
parentd5ddc6c1f7ac69aaeb3f9d26610839ed8d75c8c2 (diff)
parent2a8f34ad8b968e44916d238adafac44d7b14a25b (diff)
downloadrails-786a0195cb76f96a29896467969044f222597ae4.tar.gz
rails-786a0195cb76f96a29896467969044f222597ae4.tar.bz2
rails-786a0195cb76f96a29896467969044f222597ae4.zip
Merge pull request #4741 from pacoguzman/initialize_variable_not_needed
Remove initialize variable columnn, not needed
Diffstat (limited to 'activerecord/lib/active_record/validations')
-rw-r--r--activerecord/lib/active_record/validations/uniqueness.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/validations/uniqueness.rb b/activerecord/lib/active_record/validations/uniqueness.rb
index 3a741ba600..7fd5d76ba5 100644
--- a/activerecord/lib/active_record/validations/uniqueness.rb
+++ b/activerecord/lib/active_record/validations/uniqueness.rb
@@ -57,8 +57,7 @@ module ActiveRecord
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]