Rails has a short hand for what you're doing here. It's not wrong, but you should be using the rails convention.
http://guides.rubyonrails.org/active_record_querying.html#scopes