Module: ActiveLdap::AttributeMethods::Dirty — activeldap - ActiveLdap

Module: ActiveLdap::AttributeMethods::Dirty

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::Dirty
Defined in:
lib/active_ldap/attribute_methods/dirty.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) reload

reload the record and clears changed attributes.



27
28
29
30
31
32
# File 'lib/active_ldap/attribute_methods/dirty.rb', line 27

def reload(*) #:nodoc:
  super.tap do
    @previously_changed.clear
    @changed_attributes.clear
  end
end

- (Object) save

Attempts to save the record and clears changed attributes if successful.



9
10
11
12
13
14
15
16
# File 'lib/active_ldap/attribute_methods/dirty.rb', line 9

def save(*) #:nodoc:
  succeeded = super
  if succeeded
    @previously_changed = changes
    @changed_attributes.clear
  end
  succeeded
end

- (Object) save!

Attempts to save! the record and clears changed attributes if successful.



19
20
21
22
23
24
# File 'lib/active_ldap/attribute_methods/dirty.rb', line 19

def save!(*) #:nodoc:
  super.tap do
    @previously_changed = changes
    @changed_attributes.clear
  end
end