aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-04-10 15:34:55 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-04-10 15:34:55 -0300
commit085ce4f1411238a6109fb9c22fdb2c46b27c2c0e (patch)
treee57262b3e867ee6fef40e63e09619fffde075d8e /activerecord/lib/active_record/persistence.rb
parent54d8c81fefdb566c2f317afd0142cade0273bdbc (diff)
parent53610e5140149aca3a15a27ef103350a5969f7aa (diff)
downloadrails-085ce4f1411238a6109fb9c22fdb2c46b27c2c0e.tar.gz
rails-085ce4f1411238a6109fb9c22fdb2c46b27c2c0e.tar.bz2
rails-085ce4f1411238a6109fb9c22fdb2c46b27c2c0e.zip
Merge branch 'master' into rm-uuid-fixtures
Conflicts: activerecord/CHANGELOG.md activesupport/CHANGELOG.md
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r--activerecord/lib/active_record/persistence.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index 1a2581f579..13d7432773 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -484,24 +484,24 @@ module ActiveRecord
def create_or_update
raise ReadOnlyRecord if readonly?
- result = new_record? ? create_record : update_record
+ result = new_record? ? _create_record : _update_record
result != false
end
# Updates the associated record with values matching those of the instance attributes.
# Returns the number of affected rows.
- def update_record(attribute_names = @attributes.keys)
+ def _update_record(attribute_names = @attributes.keys)
attributes_values = arel_attributes_with_values_for_update(attribute_names)
if attributes_values.empty?
0
else
- self.class.unscoped.update_record attributes_values, id, id_was
+ self.class.unscoped._update_record attributes_values, id, id_was
end
end
# Creates a record with values matching those of the instance attributes
# and returns its id.
- def create_record(attribute_names = @attributes.keys)
+ def _create_record(attribute_names = @attributes.keys)
attributes_values = arel_attributes_with_values_for_create(attribute_names)
new_id = self.class.unscoped.insert attributes_values