Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. class Requests < ActiveRecord::Base
  2. scope :match, lambda {|user2_id| where(:user2_id => user2_id)}
  3. end
  4.  
  5. class RequestController < ApplicationController
  6. def requests
  7. @user_id=user_id
  8. @requests = Requests.match(user_id)
  9. @user = Users.findname(user_id)
  10. end
  11.  
  12. def show
  13. @package = Packages.find_by_id(requests.package_id)
  14. end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement