diff options
author | Dmitry Polushkin <dmitry.polushkin@gmail.com> | 2011-09-15 09:39:26 +0100 |
---|---|---|
committer | Dmitry Polushkin <dmitry.polushkin@gmail.com> | 2011-09-15 09:39:26 +0100 |
commit | 9d54f8994d09db5435d6c234430ae13333928fb9 (patch) | |
tree | 12413c10ed50c181f5bea0980edca998e72969bb /activerecord/lib/active_record/base.rb | |
parent | edd2f21e8095fe4a38e812025b4d9fd0e0cc28f1 (diff) | |
parent | da7f0426ec7b0aa053489633c2a8a3da6423654f (diff) | |
download | rails-9d54f8994d09db5435d6c234430ae13333928fb9.tar.gz rails-9d54f8994d09db5435d6c234430ae13333928fb9.tar.bz2 rails-9d54f8994d09db5435d6c234430ae13333928fb9.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 2979ad1cb3..558b341c06 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -442,7 +442,7 @@ module ActiveRecord #:nodoc: class << self # Class methods delegate :find, :first, :first!, :last, :last!, :all, :exists?, :any?, :many?, :to => :scoped - delegate :first_or_create, :first_or_create!, :first_or_new, :first_or_build, :to => :scoped + delegate :first_or_create, :first_or_create!, :first_or_initialize, :to => :scoped delegate :destroy, :destroy_all, :delete, :delete_all, :update, :update_all, :to => :scoped delegate :find_each, :find_in_batches, :to => :scoped delegate :select, :group, :order, :except, :reorder, :limit, :offset, :joins, :where, :preload, :eager_load, :includes, :from, :lock, :readonly, :having, :create_with, :to => :scoped @@ -1332,7 +1332,7 @@ MSG # Returns the class descending directly from ActiveRecord::Base or an # abstract class, if any, in the inheritance hierarchy. def class_of_active_record_descendant(klass) - if klass.superclass == Base || klass.superclass.abstract_class? + if klass == Base || klass.superclass == Base || klass.superclass.abstract_class? klass elsif klass.superclass.nil? raise ActiveRecordError, "#{name} doesn't belong in a hierarchy descending from ActiveRecord" |