Created
April 15, 2012 16:25
-
-
Save DiveInto/2393685 to your computer and use it in GitHub Desktop.
scope rails
This file contains 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 SellInfo < ActiveRecord::Base | |
belongs_to :book | |
belongs_to :user | |
scope :onsale,:conditions => ['deal_status is not "sold"'] | |
scope :saled,:conditions => {:deal_status => "sold"} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment