Module: LHS::Service::FindBy::ClassMethods
- Defined in:
- lib/lhs/concerns/service/find_by.rb
Instance Method Summary collapse
-
#find_by(params = {}) ⇒ Object
Fetch some record by parameters.
-
#find_by!(params = {}) ⇒ Object
Raise if no record was found.
Instance Method Details
#find_by(params = {}) ⇒ Object
Fetch some record by parameters
11 12 13 14 15 |
# File 'lib/lhs/concerns/service/find_by.rb', line 11 def find_by(params = {}) _find_by(params) rescue LHC::NotFound nil end |
#find_by!(params = {}) ⇒ Object
Raise if no record was found
18 19 20 |
# File 'lib/lhs/concerns/service/find_by.rb', line 18 def find_by!(params = {}) _find_by(params) end |