Module: MuckUsers::Models::MuckAccessCodeRequest::ClassMethods

Defined in:
lib/muck-users/models/access_code_request.rb

Instance Method Summary collapse

Instance Method Details

#get_requests(limit = nil) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/muck-users/models/access_code_request.rb', line 20

def get_requests(limit = nil)
  if limit && limit.to_i > 0
    self.by_oldest.unfullfilled.all(:limit => limit)
  else
    self.by_oldest.unfullfilled
  end
end

#mark_fullfilled(access_code_requests) ⇒ Object



28
29
30
31
32
# File 'lib/muck-users/models/access_code_request.rb', line 28

def mark_fullfilled(access_code_requests)
  access_code_requests.each do |r|
    r.update_attribute(:code_sent_at, DateTime.now)
  end
end