aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-12-21 06:16:42 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-12-21 06:16:42 +0000
commit43f6643b8b3a6892105ba9db23bdafd4c8d49ac3 (patch)
treea6d131709f797602f38f1485602ea74297a7a47e /activerecord/lib
parent71dcc6982e7dcf29675cd3871523e6bdb9cd05a3 (diff)
downloadrails-43f6643b8b3a6892105ba9db23bdafd4c8d49ac3.tar.gz
rails-43f6643b8b3a6892105ba9db23bdafd4c8d49ac3.tar.bz2
rails-43f6643b8b3a6892105ba9db23bdafd4c8d49ac3.zip
Fix form_for use of datetime_select and date_select as well as a few stylistic upgrades to AR
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3330 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/base.rb7
1 files changed, 4 insertions, 3 deletions
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