File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
lib/callback_hell/analyzers Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,13 @@ class CallbackAnalyzer
1010 ] . freeze
1111
1212 RAILS_ATTRIBUTE_OWNERS = [
13- defined? ( ActiveRecord ::Normalization ) ? ActiveRecord ::Normalization : ActiveModel ::Attributes ::Normalization ,
14- ActiveRecord ::Encryption ::EncryptableRecord
15- ] . freeze
13+ defined? ( ActiveRecord ::Normalization ) &&
14+ ActiveRecord ::Normalization ,
15+ defined? ( ActiveModel ::Attributes ::Normalization ) &&
16+ ActiveModel ::Attributes ::Normalization ,
17+ defined? ( ActiveRecord ::Encryption ::EncryptableRecord ) &&
18+ ActiveRecord ::Encryption ::EncryptableRecord
19+ ] . compact . freeze
1620
1721 def initialize ( callback , model , defining_class )
1822 @callback = callback
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class Foo < ApplicationRecord
1414 after_create :noop
1515 around_create :noop , if : :createable?
1616
17- normalizes :name , with : -> { _1 . strip }
17+ normalizes :name , with : -> { _1 . strip } if respond_to? ( :normalizes )
1818
1919 def noop = true
2020
You can’t perform that action at this time.
0 commit comments