I have a module included in one of my models. being specific in my user model database_authenticatable is included.
devise :database_authenticatable
The module has a method valid_password?(password) I want to overwrite the method as follow
def valid_password?(password)
if my_condition_is_true
do_something_new()
else
# do what valid_password(password) always does
end
end
in my else I'm thinking of copying whatever is defined insdide of valid_password() in database_authenticatable.rb module, but i'm wondering if there is a way to just tell it to do that? like in inheritance I can do super?
Also I realized no mether what, after calling my valid_password method, it cals the module valid_password method, any idea how to avoid this?