lib/ransack/adapters/active_record/context.rb
def type_for(attr)
          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
          unless schema_cache.send(database_table_exists?, table)
            raise "No table named #{table} exists."
          end
          schema_cache.columns_hash(table)[name].type
        end
# Because the AR::Associations namespace is insane
Because the AR::Associations namespace is insane
Because the AR :: Associations namespace is insane
def type_for(attr)
          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
          unless schema_cache.send(database_table_exists?, table)
            raise "No table named #{table} exists."
          end
          schema_cache.columns_hash(table)[name].type
        end
def type_for ( attr ) 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 unless schema_cache . send ( database_table_exists? , table ) raise "No table named #{table} exists." end schema_cache . columns_hash ( table ) [ name ] . type end
Because the AR::Associations namespace is insane
Because the AR :: Associations namespace is insane
attr