Fixed receive_url problem

This commit is contained in:
TJ Peden 2010-09-18 14:30:17 +08:00 committed by Raphael Sofaer
parent a0a7d28e6d
commit e6c8cf20d3

View file

@ -26,8 +26,8 @@ class Request
validates_presence_of :destination_url, :callback_url
before_validation :clean_link
scope :for_user, lambda{ |user| where(:destination_url => user.receive_url) }
scope :from_user, lambda{ |user| where(:destination_url.ne => user.receive_url) }
scope :for_user, lambda{ |user| where(:destination_url => user.person.receive_url) }
scope :from_user, lambda{ |user| where(:destination_url.ne => user.person.receive_url) }
def self.instantiate(options = {})
person = options[:from]