1
0
Fork 0
mirror of https://github.com/activerecord-hackery/ransack.git synced 2022-11-09 13:47:45 -05:00

Revert f858dd6. Fixes #553 SQL Server performance issue.

This commit is contained in:
Jon Atack 2015-09-11 23:36:46 +02:00
parent d6208db6ef
commit 934d0fe117

View file

@ -22,13 +22,13 @@ module Ransack
def type_for(attr)
return nil unless attr && attr.valid?
name = attr.arel_attribute.name.to_s
table = attr.arel_attribute.relation.table_name
connection = attr.klass.connection
unless connection.table_exists?(table)
raise "No table named #{table} exists"
name = attr.arel_attribute.name.to_s
table = attr.arel_attribute.relation.table_name
schema_cache = @engine.connection.schema_cache
unless schema_cache.table_exists?(table)
raise "No table named #{table} exists."
end
connection.schema_cache.columns_hash(table)[name].type
schema_cache.columns_hash(table)[name].type
end
def evaluate(search, opts = {})