Class: DataMapper::Resource::PersistenceState::Clean
- Inherits:
-
Persisted
show all
- Defined in:
- lib/dm-core/resource/persistence_state/clean.rb
Overview
a persisted/unmodified resource
Instance Attribute Summary
#model, #resource
Instance Method Summary
collapse
Methods inherited from Persisted
#get
#get, #initialize
Methods included from Equalizer
#equalize
Instance Method Details
#commit ⇒ Object
22
23
24
|
# File 'lib/dm-core/resource/persistence_state/clean.rb', line 22
def commit
self
end
|
#delete ⇒ Object
18
19
20
|
# File 'lib/dm-core/resource/persistence_state/clean.rb', line 18
def delete
Deleted.new(resource)
end
|
#rollback ⇒ Object
26
27
28
|
# File 'lib/dm-core/resource/persistence_state/clean.rb', line 26
def rollback
self
end
|
#set(subject, value) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/dm-core/resource/persistence_state/clean.rb', line 6
def set(subject, value)
if not_modified?(subject, value)
self
else
state = resource.persistence_state = Dirty.new(resource)
state.set(subject, value)
end
end
|