Created
May 9, 2014 16:54
-
-
Save romaimperator/057f801fbb7746a07207 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Location < ActiveRecord::Base | |
has_many :bids | |
def accepted_bids | |
bids.merge(Bid.accepted) | |
end | |
end | |
class Bid < ActiveRecord::Base | |
belongs_to :location | |
def self.accepted | |
where(status: "accepted") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment