mirror of
https://github.com/activerecord-hackery/ransack.git
synced 2022-11-09 13:47:45 -05:00
parent
d6208db6ef
commit
934d0fe117
1 changed files with 6 additions and 6 deletions
|
@ -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 = {})
|
||||
|
|
Loading…
Reference in a new issue