Class: Logman::User

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::SecurePassword, Mongoid::Document
Defined in:
lib/models/user.rb

Instance Method Summary collapse

Instance Method Details

#bucketsObject

buckets that user have access



25
26
27
28
29
# File 'lib/models/user.rb', line 25

def buckets
  return Bucket.all if self.admin
  
  Bucket.where(:user_ids=> self.id)
end

#serializable_hash(options = {}) ⇒ Object



32
33
34
35
36
# File 'lib/models/user.rb', line 32

def serializable_hash(options={})
  options[:methods] ||= [:id]
  options[:except] ||= [:password_digest]
  super(options)
end