Merge branch 'master' into tests-rspec
Conflicts: Gemfile
This commit is contained in:
commit
7de57715f2
21 changed files with 2010 additions and 72 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,
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def receive_email?
|
||||
settings.messages['send_as_email'] == "1" && email.present?
|
||||
settings.messages['send_as_email'] && email.present?
|
||||
end
|
||||
|
||||
# Sets the user's password. It will be stored encrypted along with a random salt.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue