Module: Auth::Concerns::ChiefModelConcern

Instance Method Summary collapse

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.

Parameters:

  • callback_name (String)

    : the name of the callback which you want to know if is to be skipped

Returns:

  • (Boolean)


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_superclassesObject

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