diff options
-rwxr-xr-x | actionpack/lib/action_view/helpers/date_helper.rb | 8 | ||||
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index 397e47d616..0040095669 100755 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -76,8 +76,8 @@ module ActionView # date_select("user", "birthday", :order => [:month, :day]) # # The selects are prepared for multi-parameter assignment to an Active Record object. - def date_select(object, method, options = {}) - InstanceTag.new(object, method, self).to_date_select_tag(options) + def date_select(object_name, method, options = {}) + InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_date_select_tag(options) end # Returns a set of select tags (one for year, month, day, hour, and minute) pre-selected for accessing a specified datetime-based @@ -87,8 +87,8 @@ module ActionView # datetime_select("post", "written_on", :start_year => 1995) # # The selects are prepared for multi-parameter assignment to an Active Record object. - def datetime_select(object, method, options = {}) - InstanceTag.new(object, method, self).to_datetime_select_tag(options) + def datetime_select(object_name, method, options = {}) + InstanceTag.new(object_name, method, self, nil, options.delete(:object)).to_datetime_select_tag(options) end # Returns a set of html select-tags (one for year, month, and day) pre-selected with the +date+. diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index c533b3a873..a08cd0f2df 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -851,9 +851,10 @@ module ActiveRecord #:nodoc: hash end - method_scoping.assert_valid_keys [:find, :create] + method_scoping.assert_valid_keys([ :find, :create ]) + if f = method_scoping[:find] - f.assert_valid_keys [:conditions, :joins, :from, :offset, :limit, :readonly] + f.assert_valid_keys([ :conditions, :joins, :from, :offset, :limit, :readonly ]) f[:readonly] = true if !f[:joins].blank? && !f.has_key?(:readonly) end @@ -1448,7 +1449,7 @@ module ActiveRecord #:nodoc: # Creates a new record with values matching those of the instance attributes. def create - if self.id.nil? and connection.prefetch_primary_key?(self.class.table_name) + if self.id.nil? && connection.prefetch_primary_key?(self.class.table_name) self.id = connection.next_sequence_value(self.class.sequence_name) end |