Class Index [+]

Quicksearch

DataMapper::Resource::PersistenceState::Clean

a persisted/unmodified resource

Public Instance Methods

commit() click to toggle source
    # File lib/dm-core/resource/persistence_state/clean.rb, line 23
23:         def commit
24:           self
25:         end
delete() click to toggle source
    # File lib/dm-core/resource/persistence_state/clean.rb, line 19
19:         def delete
20:           Deleted.new(resource)
21:         end
rollback() click to toggle source
    # File lib/dm-core/resource/persistence_state/clean.rb, line 27
27:         def rollback
28:           self
29:         end
set(subject, value) click to toggle source
    # File lib/dm-core/resource/persistence_state/clean.rb, line 7
 7:         def set(subject, value)
 8:           if not_modified?(subject, value)
 9:             self
10:           else
11:             # assign to persistence_state so that if Dirty#set calls
12:             # a Relationship#set, which modifies a Property, the same
13:             # Dirty state instance will be reused.
14:             state = resource.persistence_state = Dirty.new(resource)
15:             state.set(subject, value)
16:           end
17:         end

Private Instance Methods

not_modified?(subject, value) click to toggle source
    # File lib/dm-core/resource/persistence_state/clean.rb, line 33
33:         def not_modified?(subject, value)
34:           subject.loaded?(resource) && subject.get!(resource).eql?(value)
35:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.