Skip to content

Commit

Permalink
Revert f858dd6. Fixes #553 SQL Server performance issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatack committed Sep 11, 2015
1 parent d6208db commit 934d0fe
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/ransack/adapters/active_record/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def relation_for(object)

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 = {})
Expand Down

1 comment on commit 934d0fe

@nathan-appere
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonatack any chance you remember why this was reverted? That change is still needed to work with multiple DB with AR5 it seems.

Please sign in to comment.