Module: IdentityCache::QueryAPI

Extended by:
ActiveSupport::Concern
Included in:
WithoutPrimaryIndex
Defined in:
lib/identity_cache/query_api.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#expire_cacheObject

Invalidate the cache data associated with the record.



155
156
157
158
# File 'lib/identity_cache/query_api.rb', line 155

def expire_cache
  expire_attribute_indexes
  true
end

#was_new_record?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


161
162
163
164
# File 'lib/identity_cache/query_api.rb', line 161

def was_new_record? # :nodoc:
  pk = self.class.primary_key
  !destroyed? && transaction_changed_attributes.key?(pk) && transaction_changed_attributes[pk].nil?
end