Sha256: 039e1f547e69e03fd52161f9dcae15ed520adfd2aa29d54b8ff340abb1ffb77c
Contents?: true
Size: 419 Bytes
Versions: 6
Compression:
Stored size: 419 Bytes
Contents
module DeviseJwtAuth::Concerns::MongoidSupport extend ActiveSupport::Concern def as_json(options = {}) options[:except] = (options[:except] || []) + [:_id] hash = super(options) hash['id'] = to_param hash end class_methods do # It's abstract replacement .find_by def dta_find_by(attrs = {}) find_by(attrs) rescue Mongoid::Errors::DocumentNotFound nil end end end
Version data entries
6 entries across 6 versions & 1 rubygems