migrate to Rails 4.0 (closes foodcoops#214)
Conflicts: Gemfile.lock
This commit is contained in:
parent
12d1221bfc
commit
7841245795
97 changed files with 659 additions and 557 deletions
|
|
@ -2,12 +2,9 @@ class Delivery < ActiveRecord::Base
|
|||
|
||||
belongs_to :supplier
|
||||
has_one :invoice
|
||||
has_many :stock_changes,
|
||||
:dependent => :destroy,
|
||||
:include => 'stock_article',
|
||||
:order => 'articles.name ASC'
|
||||
has_many :stock_changes, -> { includes(:stock_article).order('articles.name ASC') }, :dependent => :destroy
|
||||
|
||||
scope :recent, :order => 'created_at DESC', :limit => 10
|
||||
scope :recent, -> { order('created_at DESC').limit(10) }
|
||||
|
||||
validates_presence_of :supplier_id, :delivered_on
|
||||
validate :stock_articles_must_be_unique
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue