You need to define class method foo_bar
within your module which will accept hash and behave accordingly. You could for example do:
module Foo
module Bar
extend ActiveSupport::Concern
included do
include ActiveModel::SecurePassword
end
module ClassMethods
def foo_bar(options)
has_secure_password validations: options[:validate]
end
end
extend ClassMethods
end
end