Module: Mara::Model::Query
- Included in:
- Base
- Defined in:
- lib/mara/model/query.rb
Overview
Methods to query for a model.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#exist? ⇒ true, false
Checks if a the model exists in the table?.
Class Method Details
.included(klass) ⇒ Object
23 24 25 |
# File 'lib/mara/model/query.rb', line 23 def self.included(klass) klass.extend(ClassMethods) end |
Instance Method Details
#exist? ⇒ true, false
Checks if a the model exists in the table?
88 89 90 91 92 93 94 |
# File 'lib/mara/model/query.rb', line 88 def exist? pk = partition_key sk = conditional_sort_key self.class.find(pk, sk).present? rescue Mara::Model::NotFoundError false end |