Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Requests < ActiveRecord::Base
- scope :match, lambda {|user2_id| where(:user2_id => user2_id)}
- end
- class RequestController < ApplicationController
- def requests
- @user_id=user_id
- @requests = Requests.match(user_id)
- @user = Users.findname(user_id)
- end
- def show
- @package = Packages.find_by_id(requests.package_id)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement