Module: MarkMapper::Plugins::Querying

Extended by:
ActiveSupport::Concern
Included in:
Document
Defined in:
lib/mark_mapper/plugins/querying.rb,
lib/mark_mapper/plugins/querying/decorated_markmapper_query.rb

Defined Under Namespace

Modules: ClassMethods Classes: DecoratedMarkMapperQuery

Constant Summary collapse

Methods =
MarkMapper::Methods + [:delete, :delete_all, :destroy, :destroy_all, :find!]

Instance Method Summary collapse

Instance Method Details

#deleteObject


114
115
116
# File 'lib/mark_mapper/plugins/querying.rb', line 114

def delete
  self.class.delete(id).tap { @_destroyed = true } if persisted?
end

#destroyObject


110
111
112
# File 'lib/mark_mapper/plugins/querying.rb', line 110

def destroy
  delete
end

#save(options = {}) ⇒ Object


101
102
103
104
# File 'lib/mark_mapper/plugins/querying.rb', line 101

def save(options={})
  options.assert_valid_keys(:validate)
  create_or_update(options)
end

#save!(options = {}) ⇒ Object


106
107
108
# File 'lib/mark_mapper/plugins/querying.rb', line 106

def save!(options={})
  save(options) || raise(DocumentNotValid.new(self))
end