Merge branch 'rails3' into rails3-to-master
Conflicts: app/views/suppliers/shared_suppliers.haml
This commit is contained in:
commit
71e02ab569
6 changed files with 14 additions and 6 deletions
|
|
@ -7,8 +7,8 @@ class SharedArticle < ActiveRecord::Base
|
|||
|
||||
belongs_to :shared_supplier, :foreign_key => :supplier_id
|
||||
|
||||
def build_new_article
|
||||
shared_supplier.supplier.articles.build(
|
||||
def build_new_article(supplier)
|
||||
supplier.articles.build(
|
||||
:name => name,
|
||||
:unit => unit,
|
||||
:note => note,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ class SharedSupplier < ActiveRecord::Base
|
|||
# set correct table_name in external DB
|
||||
self.table_name = 'suppliers'
|
||||
|
||||
has_one :supplier
|
||||
has_many :suppliers
|
||||
has_many :shared_articles, :foreign_key => :supplier_id
|
||||
|
||||
# These set of attributes are used to autofill attributes of new supplier,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue