Sha256: 485d78bae241400aa1c74b9844409d63f395ab4999c1c99d0a8fb49fcc153a5c
Contents?: true
Size: 421 Bytes
Versions: 17
Compression:
Stored size: 421 Bytes
Contents
module DeviseTokenAuth::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
17 entries across 17 versions & 6 rubygems