# File lib/tire/model/persistence/storage.rb, line 51 def destroy run_callbacks :destroy do @destroyed = true end self.freeze end
TODO: Implement `new_record?` and clean up
# File lib/tire/model/persistence/storage.rb, line 60 def destroyed?; !!@destroyed; end
# File lib/tire/model/persistence/storage.rb, line 62 def persisted?; !!id; end
# File lib/tire/model/persistence/storage.rb, line 42 def save return false unless valid? run_callbacks :save do # Document#id is set in the +update_elasticsearch_index+ method, # where we have access to the JSON response end self end
# File lib/tire/model/persistence/storage.rb, line 32 def update_attribute(name, value) __update_attributes name => value save end
# File lib/tire/model/persistence/storage.rb, line 37 def update_attributes(attributes={}) __update_attributes attributes save end