Created
March 28, 2019 09:49
-
-
Save MaryKuz/a15cdccd47288f8dc6db5a4a4f8d53cf to your computer and use it in GitHub Desktop.
Write a class method for model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Product < ActiveRecord::Base | |
class << self | |
def search_by params = {} | |
params = params.try(:symbolize_keys) || {} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment