diff --git a/app/models/article.rb b/app/models/article.rb index 09f17fa4..32554e84 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -7,7 +7,7 @@ class Article < ActiveRecord::Base localize_input_of :price, :tax, :deposit # Associations - belongs_to :supplier + belongs_to :supplier, :with_deleted => true belongs_to :article_category has_many :article_prices, :order => "created_at DESC" diff --git a/app/models/article_price.rb b/app/models/article_price.rb index e946fc92..686b891c 100644 --- a/app/models/article_price.rb +++ b/app/models/article_price.rb @@ -1,6 +1,6 @@ class ArticlePrice < ActiveRecord::Base - belongs_to :article + belongs_to :article, :with_deleted => true has_many :order_articles validates_presence_of :price, :tax, :deposit, :unit_quantity diff --git a/app/models/delivery.rb b/app/models/delivery.rb index 3add6fdf..b9c04616 100644 --- a/app/models/delivery.rb +++ b/app/models/delivery.rb @@ -1,6 +1,6 @@ class Delivery < ActiveRecord::Base - belongs_to :supplier + belongs_to :supplier, :with_deleted => true has_one :invoice has_many :stock_changes, :dependent => :destroy diff --git a/app/models/financial_transaction.rb b/app/models/financial_transaction.rb index 354a3d2a..bdd7e48a 100644 --- a/app/models/financial_transaction.rb +++ b/app/models/financial_transaction.rb @@ -1,7 +1,7 @@ # financial transactions are the foodcoop internal financial transactions # only ordergroups have an account balance and are happy to transfer money class FinancialTransaction < ActiveRecord::Base - belongs_to :ordergroup + belongs_to :ordergroup, :with_deleted => true belongs_to :user validates_presence_of :amount, :note, :user_id, :ordergroup_id diff --git a/app/models/group_order.rb b/app/models/group_order.rb index 9685d3bb..96dae5b8 100644 --- a/app/models/group_order.rb +++ b/app/models/group_order.rb @@ -4,7 +4,7 @@ class GroupOrder < ActiveRecord::Base attr_accessor :group_order_articles_attributes belongs_to :order - belongs_to :ordergroup + belongs_to :ordergroup, :with_deleted => true has_many :group_order_articles, :dependent => :destroy has_many :order_articles, :through => :group_order_articles belongs_to :updated_by, :class_name => "User", :foreign_key => "updated_by_user_id" diff --git a/app/models/invoice.rb b/app/models/invoice.rb index 0feb3ede..a9f1d9ca 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -1,6 +1,6 @@ class Invoice < ActiveRecord::Base - belongs_to :supplier + belongs_to :supplier, :with_deleted => true belongs_to :delivery belongs_to :order diff --git a/app/models/order.rb b/app/models/order.rb index 67a04443..4472ddd9 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -10,7 +10,7 @@ class Order < ActiveRecord::Base has_one :invoice has_many :comments, :class_name => "OrderComment", :order => "created_at" has_many :stock_changes - belongs_to :supplier + belongs_to :supplier, :with_deleted => true belongs_to :updated_by, :class_name => 'User', :foreign_key => 'updated_by_user_id' belongs_to :created_by, :class_name => 'User', :foreign_key => 'created_by_user_id' diff --git a/app/models/order_article.rb b/app/models/order_article.rb index a6b13a27..dbceb683 100644 --- a/app/models/order_article.rb +++ b/app/models/order_article.rb @@ -4,7 +4,7 @@ class OrderArticle < ActiveRecord::Base attr_reader :update_current_price belongs_to :order - belongs_to :article + belongs_to :article, :with_deleted => true belongs_to :article_price has_many :group_order_articles, :dependent => :destroy