Module: DataMapper::Shim

Extended by:
ActiveSupport::Concern
Defined in:
lib/data_mapper/shim.rb

Defined Under Namespace

Modules: ClassMethods Classes: Enum, List, OriginalValues

Constant Summary collapse

RAISE_ON_UNHANDLED_OPTIONS =
true
BigInt =

Placeholders for DataMapper types

Class.new
Boolean =
Class.new
Discriminator =
Class.new
ParanoidDateTime =
Class.new
Resource =
Class.new
Serial =
Class.new
Text =
Class.new
Yaml =

Serializable classes

Class.new
Json =
Class.new

Instance Method Summary collapse

Instance Method Details

#attribute_dirty?(attribute) ⇒ Boolean

Returns:



66
67
68
# File 'lib/data_mapper/shim.rb', line 66

def attribute_dirty?(attribute)
  changed_attributes.has_key?(attribute.to_s)
end

#attribute_get(name) ⇒ Object

Mischellaneous helpers



58
59
60
# File 'lib/data_mapper/shim.rb', line 58

def attribute_get(name)
  read_attribute(name)
end

#attribute_set(name, value) ⇒ Object



62
63
64
# File 'lib/data_mapper/shim.rb', line 62

def attribute_set(name, value)
  write_attribute(name, value)
end

#dirty?Boolean

Returns:



70
71
72
# File 'lib/data_mapper/shim.rb', line 70

def dirty?
  changed?
end

#original_valuesObject



90
91
92
# File 'lib/data_mapper/shim.rb', line 90

def original_values
  OriginalValues.new(self)
end