aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2012-09-12 11:35:05 -0500
committerGuillermo Iguaran <guilleiguaran@gmail.com>2012-09-16 23:59:05 -0500
commit2d7ae1b08ee2a10b12cbfeef3a6cc6da55b57df6 (patch)
treeab1f52a552683df0ca320be0356bc73c4081c890 /activerecord/lib/active_record/persistence.rb
parent6ae93a0fdf457fb964149c976e7da734a548cec3 (diff)
downloadrails-2d7ae1b08ee2a10b12cbfeef3a6cc6da55b57df6.tar.gz
rails-2d7ae1b08ee2a10b12cbfeef3a6cc6da55b57df6.tar.bz2
rails-2d7ae1b08ee2a10b12cbfeef3a6cc6da55b57df6.zip
Remove mass_assignment_options from ActiveRecord
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r--activerecord/lib/active_record/persistence.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index b58b8881ac..6f38262b86 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -35,11 +35,11 @@ module ActiveRecord
# User.create([{ :first_name => 'Jamie' }, { :first_name => 'Jeremy' }]) do |u|
# u.is_admin = false
# end
- def create(attributes = nil, options = {}, &block)
+ def create(attributes = nil, &block)
if attributes.is_a?(Array)
- attributes.collect { |attr| create(attr, options, &block) }
+ attributes.collect { |attr| create(attr, &block) }
else
- object = new(attributes, options, &block)
+ object = new(attributes, &block)
object.save
object
end
@@ -188,22 +188,22 @@ module ActiveRecord
# If no +:as+ option is supplied then the +:default+ role will be used.
# If you want to bypass the forbidden attributes protection then you can do so using
# the +:without_protection+ option.
- def update_attributes(attributes, options = {})
+ def update_attributes(attributes)
# The following transaction covers any possible database side-effects of the
# attributes assignment. For example, setting the IDs of a child collection.
with_transaction_returning_status do
- assign_attributes(attributes, options)
+ assign_attributes(attributes)
save
end
end
# Updates its receiver just like +update_attributes+ but calls <tt>save!</tt> instead
# of +save+, so an exception is raised if the record is invalid.
- def update_attributes!(attributes, options = {})
+ def update_attributes!(attributes)
# The following transaction covers any possible database side-effects of the
# attributes assignment. For example, setting the IDs of a child collection.
with_transaction_returning_status do
- assign_attributes(attributes, options)
+ assign_attributes(attributes)
save!
end
end