Module: Auth::Concerns::ChiefModelConcern
- Extended by:
- ActiveSupport::Concern
- Included in:
- ActivityConcern, NotificationConcern, OwnerConcern, Shopping::CartConcern, Shopping::DiscountConcern, Shopping::PayUMoneyConcern, Shopping::PaymentConcern, Shopping::ProductConcern, SmsOtpConcern, UserConcern, Shopping::CartItemPaymentResult
- Defined in:
- app/models/auth/concerns/chief_model_concern.rb
Instance Method Summary collapse
-
#skip_callback?(callback_name) ⇒ Boolean
return : true or false.
-
#walk_superclasses ⇒ Object
- will iterate the superclasses of this class until it finds a class that begins with Auth
-
or it hits Object and then it returns that superclass whatever it is.
Instance Method Details
#skip_callback?(callback_name) ⇒ Boolean
return : true or false. checks whether the attr_accessor skip_callbacks is set, and if yes, then whether the name of this callback exists in it. if both above are no, then returns false if the name exists, then return whatever is stored for the name i.e true or false.
116 117 118 119 |
# File 'app/models/auth/concerns/chief_model_concern.rb', line 116 def skip_callback?(callback_name) return false if (self.skip_callbacks.blank? || self.skip_callbacks[callback_name.to_sym].nil?) return self.skip_callbacks[callback_name.to_sym] == true end |
#walk_superclasses ⇒ Object
will iterate the superclasses of this class
- until it finds a class that begins with Auth
-
or it hits Object and then it returns that superclass whatever it is.
125 126 127 128 129 130 131 132 |
# File 'app/models/auth/concerns/chief_model_concern.rb', line 125 def walk_superclasses my_super_class = self.class.superclass while my_super_class != Object break if my_super_class.to_s =~ /^Auth::/ my_super_class = my_super_class.superclass end return my_super_class end |