Define autofill attributes when creating new supplier from shared_supplier.

This commit is contained in:
Benjamin Meichsner 2013-06-09 18:02:47 +02:00
parent e74c6b4068
commit 7c4ee01ff2
2 changed files with 8 additions and 2 deletions

View file

@ -7,6 +7,12 @@ class SharedSupplier < ActiveRecord::Base
has_one :supplier
has_many :shared_articles, :foreign_key => :supplier_id
# These set of attributes are used to autofill attributes of new supplier,
# when created by import from shared supplier feature.
def autofill_attributes
whitelist = %w(name address phone fax email url delivery_days note)
attributes.select { |k,_v| whitelist.include?(k) }
end
end