activeldap/activeldap@019d7c7 [master] Support Active Model 5.2.0

0 views
Skip to first unread message

Kouhei Sutou

unread,
Apr 28, 2018, 2:41:12 AM4/28/18
to activeld...@googlegroups.com
Author
Kouhei Sutou <k...@clear-code.com>
Date
2018-04-28 15:24:53 +0900 (Sat, 28 Apr 2018)
New Revision
019d7c725eec9a038158248877f5e8ac2e014933
Message
Support Active Model 5.2.0
Modified files
  Modified: lib/active_ldap/attribute_methods/dirty.rb (+3 -6)
===================================================================
...
9
10
11
12
13
 
14
15
16
...
18
19
20
21
22
 
23
24
25
26
27
28
29
30
 
31
32
33
...
9
10
11
 
 
12
13
14
15
...
17
18
19
 
 
20
21
22
23
24
25
26
 
 
27
28
29
30
@@ -9,8 +9,7 @@ module ActiveLdap
       def save(*) #:nodoc:
         succeeded = super
         if succeeded
-          @previously_changed = changes
-          @changed_attributes.clear
+          changes_applied
         end
         succeeded
       end
@@ -18,16 +17,14 @@ module ActiveLdap
       # Attempts to <tt>save!</tt> the record and clears changed attributes if successful.
       def save!(*) #:nodoc:
         super.tap do
-          @previously_changed = changes
-          @changed_attributes.clear
+          changes_applied
         end
       end
 
       # <tt>reload</tt> the record and clears changed attributes.
       def reload(*) #:nodoc:
         super.tap do
-          @previously_changed.clear
-          @changed_attributes.clear
+          clear_changes_information
         end
       end
 
  Modified: lib/active_ldap/attribute_methods/read.rb (+4 -0)
===================================================================
...
8
9
10
 
 
 
 
11
12
13
...
8
9
10
11
12
13
14
15
16
17
@@ -8,6 +8,10 @@ module ActiveLdap
         return get_attribute(attr, args.first)
       end
 
+      def _read_attribute(name)
+        get_attribute(name)
+      end
+
       # get_attribute
       #
       # Return the value of the attribute called by method_missing?
  Modified: lib/active_ldap/base.rb (+2 -6)
===================================================================
...
946
947
948
949
950
951
 
952
953
954
...
1117
1118
1119
1120
 
1121
1122
1123
...
1167
1168
1169
1170
1171
1172
1173
1174
...
946
947
948
 
 
 
949
950
951
952
...
1115
1116
1117
 
1118
1119
1120
1121
...
1165
1166
1167
 
 
1168
1169
1170
@@ -946,9 +946,7 @@ module ActiveLdap
     def clear_object_class_based_cache
       @entry_attribute = nil
       @real_names = {}
-      @changed_attributes.reject! do |key, _|
-        not attribute_method?(key)
-      end
+      clear_changes_information
     end
 
     def clear_removed_attributes_data(removed_attributes)
@@ -1117,7 +1115,7 @@ module ActiveLdap
         end
         set_attribute(key, value)
       end
-      @changed_attributes.clear
+      clear_changes_information
     end
     private :initialize_attributes
 
@@ -1167,8 +1165,6 @@ module ActiveLdap
       @dn_split_value = nil
       @connection ||= nil
       @_hashing = false
-      @previously_changed = []
-      @changed_attributes = {}
       clear_connection_based_cache
     end
 
Reply all
Reply to author
Forward
0 new messages