Simplify SearchController#results

Give names to the various things being searched for and move them out
into their own methods. Also add scopes to give names to things being
queried out of the models.
This commit is contained in:
Matt Rogers 2013-03-12 19:49:19 -05:00
parent 63fc460c00
commit f541a4c9d6
4 changed files with 34 additions and 26 deletions

View file

@ -4,4 +4,5 @@ class Note < ActiveRecord::Base
attr_protected :user
scope :with_body, lambda { |terms| where("body LIKE ?", terms) }
end