Skip to content

Commit

Permalink
[#740 state:resolved] allow table name to be specified in search scope
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanlarsen committed Jun 16, 2010
1 parent 2f4aa95 commit 741fc75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hobo/lib/hobo/scopes/automatic_scopes.rb
Expand Up @@ -275,7 +275,7 @@ def create_scope
words = query.split
args = []
word_queries = words.map do |word|
field_query = '(' + fields.map { |field| "(#{@klass.table_name}.#{field} like ?)" }.join(" OR ") + ')'
field_query = '(' + fields.map { |field| "(#{@klass.table_name+'.' unless field.to_s.index('.')}#{field} like ?)" }.join(" OR ") + ')'
args += ["%#{word}%"] * fields.length
field_query
end
Expand Down

0 comments on commit 741fc75

Please sign in to comment.