Sha256: f1fa1b331c99535a7931d1132448f5e2b712a4094cd62017f71e3babc3613134
Contents?: true
Size: 1.14 KB
Versions: 4
Compression:
Stored size: 1.14 KB
Contents
module Sorcery module Model module Adapters module MongoMapper extend ActiveSupport::Concern included do include Sorcery::Model end module InstanceMethods def increment(attr) self.inc(attr,1) end def save!(options = {}) save(options) end end module ClassMethods def find_by_credentials(credentials) @sorcery_config.username_attribute_names.each do |attribute| @user = where(attribute => credentials[0]).first break if @user end @user end def find_by_id(id) find(id) end def find_by_activation_token(token) where(sorcery_config.activation_token_attribute_name => token).first end def transaction(&blk) tap(&blk) end def find_by_sorcery_token(token_attr_name, token) where(token_attr_name => token).first end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems