Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Make FacetsBuilder#column use ActiveRecord::Base#columns_hash instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Dai committed May 26, 2008
1 parent 14d909f commit 75113a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/searchify/facets_builder.rb
Expand Up @@ -57,7 +57,7 @@ def facets_from_association(name, arguments)
end

def column(name)
@model_class.columns.detect { |c| c.name.to_s == name.to_s }
@model_class.columns_hash[name.to_s]
end

def association_reflection(name)
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -33,6 +33,10 @@ def self.columns
@columns || []
end

def self.columns_hash
columns.index_by{|c| c.name.to_s}
end

def self.inspect
"Model Mock"
end
Expand Down

0 comments on commit 75113a4

Please sign in to comment.