module SmartEnum::ActiveRecordCompatibility
Public Class Methods
included(base)
click to toggle source
# File lib/smart_enum/active_record_compatibility.rb, line 10 def self.included(base) base.include(ActiveModel::Serialization) base.extend(ActiveModel::Naming) base.extend(ClassMethods) base.extend(QueryMethods) end
Public Instance Methods
_read_attribute(attribute_name)
click to toggle source
# File lib/smart_enum/active_record_compatibility.rb, line 45 def _read_attribute(attribute_name) attributes.fetch(attribute_name.to_sym) end
destroyed?()
click to toggle source
# File lib/smart_enum/active_record_compatibility.rb, line 49 def destroyed? false end
marked_for_destruction?()
click to toggle source
# File lib/smart_enum/active_record_compatibility.rb, line 57 def marked_for_destruction? false end
new_record?()
click to toggle source
# File lib/smart_enum/active_record_compatibility.rb, line 53 def new_record? false end
persisted?()
click to toggle source
# File lib/smart_enum/active_record_compatibility.rb, line 61 def persisted? true end
to_key()
click to toggle source
# File lib/smart_enum/active_record_compatibility.rb, line 41 def to_key [id] end