Class: Lighthouse::User

Inherits:
Base
  • Object
show all
Defined in:
lib/fresnel/lighthouse.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited

Class Method Details

.find(*args, &block) ⇒ Object



173
174
175
176
177
178
179
180
181
182
183
# File 'lib/fresnel/lighthouse.rb', line 173

def self.find(*args, &block)
  if (user_id = args.first.to_i) > 0
    cache = Cache.new
    cache = Cache.new
    cache.load(:name => "user_#{user_id}") do
      super(*args, &block)
    end
  else
    super(*args, &block)
  end
end

Instance Method Details

#memberships(options = {}) ⇒ Object



185
186
187
# File 'lib/fresnel/lighthouse.rb', line 185

def memberships(options = {})
  Membership.find(:all, :params => {:user_id => id})
end