Rails 4.1 API change

This commit is contained in:
Sam 2014-05-08 15:22:02 +10:00
parent ffd18ca0ca
commit dddb2e19fc

View file

@ -101,7 +101,7 @@ module RailsMultisite
end end
@@db_spec_cache = Hash[*configs.map do |k, data| @@db_spec_cache = Hash[*configs.map do |k, data|
[k, spec_klass::Resolver.new(k, configs).spec] [k, spec_klass::Resolver.new(configs).spec(k)]
end.flatten] end.flatten]
@@host_spec_cache = {} @@host_spec_cache = {}
@ -112,7 +112,7 @@ module RailsMultisite
end end
end end
@@default_spec = spec_klass::Resolver.new(Rails.env, ActiveRecord::Base.configurations).spec @@default_spec = spec_klass::Resolver.new(ActiveRecord::Base.configurations).spec(Rails.env)
ActiveRecord::Base.configurations[Rails.env]["host_names"].each do |host| ActiveRecord::Base.configurations[Rails.env]["host_names"].each do |host|
@@host_spec_cache[host] = @@default_spec @@host_spec_cache[host] = @@default_spec
end end