Module: Tengine::Core::FindByName::ClassMethods
- Defined in:
- lib/tengine/core/find_by_name.rb
Instance Method Summary collapse
Instance Method Details
#find_by_name(name) ⇒ Object
21 22 23 |
# File 'lib/tengine/core/find_by_name.rb', line 21 def find_by_name(name) where({:name => name}).first end |
#find_by_name!(name, *args, &block) ⇒ Object
25 26 27 28 29 |
# File 'lib/tengine/core/find_by_name.rb', line 25 def find_by_name!(name, *args, &block) result = find_by_name(name, *args, &block) raise Error.new(self, name, args.last) unless result result end |