aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-12 00:34:40 -0700
committerJosé Valim <jose.valim@gmail.com>2011-05-12 00:34:40 -0700
commit987f79cda890d37fd5c3da8a64dac5c797956291 (patch)
tree284a7ce2bd46cad00c62a630cf1863982c774ca3 /activerecord/lib
parent8cf4725f640603944bb6e69816807f6541c94d9f (diff)
parenta0000d0ea096dc3c6f811b57d006a80d59057e53 (diff)
downloadrails-987f79cda890d37fd5c3da8a64dac5c797956291.tar.gz
rails-987f79cda890d37fd5c3da8a64dac5c797956291.tar.bz2
rails-987f79cda890d37fd5c3da8a64dac5c797956291.zip
Merge pull request #524 from joshk/ar_create_mas_correction
AR#create! allows for :as => role, and AR changelog update
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/session_store.rb4
-rw-r--r--activerecord/lib/active_record/validations.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/session_store.rb b/activerecord/lib/active_record/session_store.rb
index 98e21db908..c3e976002e 100644
--- a/activerecord/lib/active_record/session_store.rb
+++ b/activerecord/lib/active_record/session_store.rb
@@ -40,7 +40,7 @@ module ActiveRecord
# You must implement these methods:
#
# self.find_by_session_id(session_id)
- # initialize(hash_of_session_id_and_data)
+ # initialize(hash_of_session_id_and_data, options_hash = {})
# attr_reader :session_id
# attr_accessor :data
# save
@@ -125,7 +125,7 @@ module ActiveRecord
end
end
- def initialize(attributes = nil)
+ def initialize(attributes = nil, options = {})
@data = nil
super
end
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index de36dd20b3..59b6876135 100644
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -32,11 +32,11 @@ module ActiveRecord
module ClassMethods
# Creates an object just like Base.create but calls <tt>save!</tt> instead of +save+
# so an exception is raised if the record is invalid.
- def create!(attributes = nil, &block)
+ def create!(attributes = nil, options = {}, &block)
if attributes.is_a?(Array)
- attributes.collect { |attr| create!(attr, &block) }
+ attributes.collect { |attr| create!(attr, options, &block) }
else
- object = new(attributes)
+ object = new(attributes, options)
yield(object) if block_given?
object.save!
object