Skip to content

Instantly share code, notes, and snippets.

@DiveInto
Created April 15, 2012 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DiveInto/2393685 to your computer and use it in GitHub Desktop.
Save DiveInto/2393685 to your computer and use it in GitHub Desktop.
scope rails
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