Fixed showing deleted articles when asking for available articles.
This commit is contained in:
parent
dd0bd0ad7e
commit
59de2e42a9
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ class Article < ActiveRecord::Base
|
||||||
has_many :article_prices, :order => "created_at DESC"
|
has_many :article_prices, :order => "created_at DESC"
|
||||||
|
|
||||||
scope :undeleted, -> { where(deleted_at: nil) }
|
scope :undeleted, -> { where(deleted_at: nil) }
|
||||||
scope :available, :conditions => {:availability => true}
|
scope :available, -> { undeleted.where(availability: true) }
|
||||||
scope :not_in_stock, :conditions => {:type => nil}
|
scope :not_in_stock, :conditions => {:type => nil}
|
||||||
|
|
||||||
# Validations
|
# Validations
|
||||||
|
|
Loading…
Reference in a new issue