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, Work::Bullet, Work::Instruction, Work::Link
- 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.
140 141 142 143 |
# File 'app/models/auth/concerns/chief_model_concern.rb', line 140 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.
149 150 151 152 153 154 155 156 |
# File 'app/models/auth/concerns/chief_model_concern.rb', line 149 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 |