aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/railtie.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-10-26 15:51:02 +0100
committerJon Leighton <j@jonathanleighton.com>2012-10-26 15:51:02 +0100
commit9e4c41c903e8e58721f2c41776a8c60ddba7a0a9 (patch)
treed580824995d5ea4866b1d976818f3e3d03a02e53 /activerecord/lib/active_record/railtie.rb
parenta27b5178d9f1011545ecbf94008c5d890bab25d0 (diff)
downloadrails-9e4c41c903e8e58721f2c41776a8c60ddba7a0a9.tar.gz
rails-9e4c41c903e8e58721f2c41776a8c60ddba7a0a9.tar.bz2
rails-9e4c41c903e8e58721f2c41776a8c60ddba7a0a9.zip
Remove ActiveRecord::Model
In the end I think the pain of implementing this seamlessly was not worth the gain provided. The intention was that it would allow plain ruby objects that might not live in your main application to be subclassed and have persistence mixed in. But I've decided that the benefit of doing that is not worth the amount of complexity that the implementation introduced.
Diffstat (limited to 'activerecord/lib/active_record/railtie.rb')
-rw-r--r--activerecord/lib/active_record/railtie.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb
index d7e35fb771..77e41ea927 100644
--- a/activerecord/lib/active_record/railtie.rb
+++ b/activerecord/lib/active_record/railtie.rb
@@ -80,7 +80,7 @@ module ActiveRecord
if File.file?(filename)
cache = Marshal.load File.binread filename
if cache.version == ActiveRecord::Migrator.current_version
- ActiveRecord::Model.connection.schema_cache = cache
+ self.connection.schema_cache = cache
else
warn "Ignoring db/schema_cache.dump because it has expired. The current schema version is #{ActiveRecord::Migrator.current_version}, but the one in the cache is #{cache.version}."
end
@@ -122,8 +122,8 @@ module ActiveRecord
ActiveSupport.on_load(:active_record) do
ActionDispatch::Reloader.send(hook) do
- ActiveRecord::Model.clear_reloadable_connections!
- ActiveRecord::Model.clear_cache!
+ ActiveRecord::Base.clear_reloadable_connections!
+ ActiveRecord::Base.clear_cache!
end
end
end
@@ -135,13 +135,12 @@ module ActiveRecord
config.after_initialize do |app|
ActiveSupport.on_load(:active_record) do
- ActiveRecord::Model.instantiate_observers
+ instantiate_observers
ActionDispatch::Reloader.to_prepare do
- ActiveRecord::Model.instantiate_observers
+ ActiveRecord::Base.instantiate_observers
end
end
-
end
end
end