public
Description: Rails plugin to add extra searching functionality to models.
Clone URL: git://github.com/ryanb/searchify.git
Make FacetsBuilder#column use ActiveRecord::Base#columns_hash instead.
David Dai (author)
Mon May 26 05:58:41 -0700 2008
commit  75113a4fd89ed09c4d01d7555a40b57bd41c1dad
tree    b05277c5c7dc3693cf449f1713f898544f82e4ff
parent  14d909f944a7312f59944197af2922b41c006607
...
57
58
59
60
 
61
62
63
...
57
58
59
 
60
61
62
63
0
@@ -57,7 +57,7 @@ module Searchify
0
     end
0
     
0
     def column(name)
0
- @model_class.columns.detect { |c| c.name.to_s == name.to_s }
0
+ @model_class.columns_hash[name.to_s]
0
     end
0
     
0
     def association_reflection(name)
...
33
34
35
 
 
 
 
36
37
38
...
33
34
35
36
37
38
39
40
41
42
0
@@ -33,6 +33,10 @@ class MockedModel < ActiveRecord::Base
0
     @columns || []
0
   end
0
   
0
+ def self.columns_hash
0
+ columns.index_by{|c| c.name.to_s}
0
+ end
0
+
0
   def self.inspect
0
     "Model Mock"
0
   end

Comments

    No one has commented yet.