We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0b7632 commit de74493Copy full SHA for de74493
lib/paranoia.rb
@@ -173,8 +173,25 @@ def really_destroy!(update_destroy_attributes: true)
173
174
private
175
176
+ def counter_cache_disabled?
177
+ defined?(@_disable_counter_cache) && @_disable_counter_cache
178
+ end
179
+
180
+ def counter_cached_association_names
181
+ return [] if counter_cache_disabled?
182
+ super
183
184
185
def each_counter_cached_associations
- !(defined?(@_disable_counter_cache) && @_disable_counter_cache) ? super : []
186
187
188
+ if defined?(super)
189
190
+ else
191
+ counter_cached_association_names.each do |name|
192
+ yield association(name)
193
194
195
end
196
197
def paranoia_restore_attributes
0 commit comments