Class: DataMapper::Resource::PersistenceState::Transient
Overview
a not-persisted/modifiable resource
Instance Attribute Summary
#resource
Instance Method Summary
collapse
#initialize
Methods included from Equalizer
#equalize
Instance Method Details
#commit ⇒ Object
21
22
23
24
25
26
27
28
29
|
# File 'lib/dm-core/resource/persistence_state/transient.rb', line 21
def commit
set_child_keys
set_default_values
return self unless valid_attributes?
create_resource
set_repository
add_to_identity_map
Clean.new(resource)
end
|
#delete ⇒ Object
17
18
19
|
# File 'lib/dm-core/resource/persistence_state/transient.rb', line 17
def delete
self
end
|
#get(subject, *args) ⇒ Object
7
8
9
10
|
# File 'lib/dm-core/resource/persistence_state/transient.rb', line 7
def get(subject, *args)
set_default_value(subject)
super
end
|
#original_attributes ⇒ Object
35
36
37
|
# File 'lib/dm-core/resource/persistence_state/transient.rb', line 35
def original_attributes
@original_attributes ||= {}
end
|
#rollback ⇒ Object
31
32
33
|
# File 'lib/dm-core/resource/persistence_state/transient.rb', line 31
def rollback
self
end
|
#set(subject, value) ⇒ Object
12
13
14
15
|
# File 'lib/dm-core/resource/persistence_state/transient.rb', line 12
def set(subject, value)
track(subject)
super
end
|