aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-01-17 03:10:07 +0530
committerPratik Naik <pratiknaik@gmail.com>2010-01-17 03:10:07 +0530
commit6806483b913aba611af48c1630f229a76a98ecc7 (patch)
tree798d3500c3edc8d4128f147fb6827ddd8f6db87a /activerecord
parent0ab30637dd5bc7536c5accd66b45ce0263134a14 (diff)
downloadrails-6806483b913aba611af48c1630f229a76a98ecc7.tar.gz
rails-6806483b913aba611af48c1630f229a76a98ecc7.tar.bz2
rails-6806483b913aba611af48c1630f229a76a98ecc7.zip
Use arel_table[] instead of unscoped[] to get arel attribute
Diffstat (limited to 'activerecord')
-rwxr-xr-xactiverecord/lib/active_record/base.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index b0c9ed2548..3c4a9fe99d 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -2193,7 +2193,7 @@ module ActiveRecord #:nodoc:
# be made (since they can't be persisted).
def destroy
unless new_record?
- self.class.unscoped.where(self.class.unscoped[self.class.primary_key].eq(id)).delete_all
+ self.class.unscoped.where(self.class.arel_table[self.class.primary_key].eq(id)).delete_all
end
@destroyed = true
@@ -2480,7 +2480,7 @@ module ActiveRecord #:nodoc:
def update(attribute_names = @attributes.keys)
attributes_with_values = arel_attributes_values(false, false, attribute_names)
return 0 if attributes_with_values.empty?
- self.class.unscoped.where(self.class.unscoped[self.class.primary_key].eq(id)).update(attributes_with_values)
+ self.class.unscoped.where(self.class.arel_table[self.class.primary_key].eq(id)).update(attributes_with_values)
end
# Creates a record with values matching those of the instance attributes
@@ -2590,7 +2590,7 @@ module ActiveRecord #:nodoc:
if value && ((self.class.serialized_attributes.has_key?(name) && (value.acts_like?(:date) || value.acts_like?(:time))) || value.is_a?(Hash) || value.is_a?(Array))
value = value.to_yaml
end
- attrs[self.class.unscoped[name]] = value
+ attrs[self.class.arel_table[name]] = value
end
end
end