diff options
author | jessib <jessib@riseup.net> | 2013-10-10 11:05:09 -0700 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2013-10-10 11:05:09 -0700 |
commit | 5627b01230cdfa918ad144b26183b4c0bf151360 (patch) | |
tree | 3c6c7f8798e3cf21b5d157948c0e42582da496f4 /core/lib/extensions | |
parent | 4e471f6b35c012d2825f6be19e24ecd5fef8d636 (diff) | |
parent | 0acbf6a158f149c1f4273bde0cfca47547e080f8 (diff) |
Merge branch 'develop' into feature/billing-past-due-subscriptions
Diffstat (limited to 'core/lib/extensions')
-rw-r--r-- | core/lib/extensions/couchrest.rb | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/core/lib/extensions/couchrest.rb b/core/lib/extensions/couchrest.rb index 176184f..91dfc1c 100644 --- a/core/lib/extensions/couchrest.rb +++ b/core/lib/extensions/couchrest.rb @@ -42,30 +42,32 @@ module CouchRest end - class Migrate - def self.load_all_models_with_engines - self.load_all_models_without_engines - return unless defined?(Rails) - Dir[Rails.root + 'app/models/**/*.rb'].each do |path| - require path + module Utils + module Migrate + def self.load_all_models_with_engines + self.load_all_models_without_engines + return unless defined?(Rails) + Dir[Rails.root + 'app/models/**/*.rb'].each do |path| + require path + end + Dir[Rails.root + '*/app/models/**/*.rb'].each do |path| + require path + end end - Dir[Rails.root + '*/app/models/**/*.rb'].each do |path| - require path + + def self.all_models_and_proxies + callbacks = migrate_each_model(find_models) + callbacks += migrate_each_proxying_model(find_proxying_models) + cleanup(callbacks) end - end - def self.all_models_and_proxies - callbacks = migrate_each_model(find_models) - callbacks += migrate_each_proxying_model(find_proxying_models) - cleanup(callbacks) - end + class << self + alias_method_chain :load_all_models, :engines + end - class << self - alias_method_chain :load_all_models, :engines end - end end |