Fixed showing deleted articles when asking for available articles.

This commit is contained in:
Benjamin Meichsner 2013-03-17 18:36:17 +01:00
parent dd0bd0ad7e
commit 59de2e42a9

View file

@ -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