Skip to content

Commit 3f3b612

Browse files
Replace with one map
1 parent 4c47a00 commit 3f3b612

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/meta_search/searches/mongoid.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def method_missing name, *args, &block
9292
end
9393

9494
def metasearch_regexp
95-
field_names = klass.fields.map(&:second).map(&:name)
95+
field_names = klass.fields.map{ |field| field.second.name }
9696
conditions = MetaSearch::DEFAULT_WHERES.map {|condition| condition[0...-1]} # pop tail options
9797

9898
/\A(#{field_names.join('|')})_(#{conditions.join('|')})\z/

0 commit comments

Comments
 (0)