Sha256: b5fe52a08871db7fd0e9d8a45a2e2e40b43c273b46b53789e8349beb57b5f0c6

Contents?: true

Size: 943 Bytes

Versions: 14

Compression:

Stored size: 943 Bytes

Contents

#
module ActiveLdap
  module AttributeMethods
    module Dirty
      extend ActiveSupport::Concern
      include ActiveModel::Dirty

      # Attempts to +save+ the record and clears changed attributes if successful.
      def save(*) #:nodoc:
        succeeded = super
        if succeeded
          changes_applied
        end
        succeeded
      end

      # Attempts to <tt>save!</tt> the record and clears changed attributes if successful.
      def save!(*) #:nodoc:
        super.tap do
          changes_applied
        end
      end

      # <tt>reload</tt> the record and clears changed attributes.
      def reload(*) #:nodoc:
        super.tap do
          clear_changes_information
        end
      end

      private
      def set_attribute(name, value)
        if name and name != "objectClass"
          attribute_will_change!(name) unless value == get_attribute(name)
        end
        super
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
activeldap-7.2.1 lib/active_ldap/attribute_methods/dirty.rb
activeldap-7.2.0 lib/active_ldap/attribute_methods/dirty.rb
activeldap-7.0.0 lib/active_ldap/attribute_methods/dirty.rb
activeldap-6.1.0 lib/active_ldap/attribute_methods/dirty.rb
activeldap-6.0.4 lib/active_ldap/attribute_methods/dirty.rb
activeldap-6.0.3 lib/active_ldap/attribute_methods/dirty.rb
activeldap-6.0.2 lib/active_ldap/attribute_methods/dirty.rb
activeldap-6.0.1 lib/active_ldap/attribute_methods/dirty.rb
activeldap-6.0.0 lib/active_ldap/attribute_methods/dirty.rb
activeldap-5.2.4 lib/active_ldap/attribute_methods/dirty.rb
activeldap-5.2.3 lib/active_ldap/attribute_methods/dirty.rb
activeldap-5.2.2 lib/active_ldap/attribute_methods/dirty.rb
activeldap-5.2.1 lib/active_ldap/attribute_methods/dirty.rb
activeldap-5.2.0 lib/active_ldap/attribute_methods/dirty.rb