Possibly improve using different database connections
This commit is contained in:
parent
495f9b0c2e
commit
f858dd6d98
|
@ -24,10 +24,11 @@ module Ransack
|
|||
return nil unless attr && attr.valid?
|
||||
name = attr.arel_attribute.name.to_s
|
||||
table = attr.arel_attribute.relation.table_name
|
||||
|
||||
schema_cache = @engine.connection.schema_cache
|
||||
raise "No table named #{table} exists" unless schema_cache.table_exists?(table)
|
||||
schema_cache.columns_hash(table)[name].type
|
||||
connection = attr.klass.connection
|
||||
unless connection.table_exists?(table)
|
||||
raise "No table named #{table} exists"
|
||||
end
|
||||
connection.schema_cache.columns_hash(table)[name].type
|
||||
end
|
||||
|
||||
def evaluate(search, opts = {})
|
||||
|
|
Loading…
Reference in New Issue