connection_names = ActiveRecord::Base.configurations.keys.select do |name|
name =~ /^well_site/
end
Rails::Initializer.run #maybe it's mistake
connection_pools = []
connection_pools = connection_names.delete_if{|v|v=="db"}.map do |connection_name|
#connection_names.delete_if{|v|v=="db"}.each do |connection_name|
Object.class_eval <<-EOS
module #{connection_name.camelize}
establish_connection :#{connection_name}
end
EOS
connection_name.camelize.constantize
end
return @@conn = connection_pools
name =~ /^well_site/
end
Rails::Initializer.run #maybe it's mistake
connection_pools = []
connection_pools = connection_names.delete_if{|v|v=="db"}.map do |connection_name|
#connection_names.delete_if{|v|v=="db"}.each do |connection_name|
Object.class_eval <<-EOS
module #{connection_name.camelize}
establish_connection :#{connection_name}
end
EOS
connection_name.camelize.constantize
end
return @@conn = connection_pools