lib/xsys/model/stock_control.rb in xsys-0.0.22 vs lib/xsys/model/stock_control.rb in xsys-0.0.23

- old
+ new

@@ -5,10 +5,14 @@ :transaction_date, :product_category_id, :product_category_name, :user_id, :user_name, :errors_count def initialize(attributes={}) attributes.each do |k,v| - self.send("#{k}=", v) if self.respond_to?(k) + if k.to_s == 'transaction_date' + self.transaction_date = Date.parse(v) unless v.nil? + else + self.send("#{k}=", v) if self.respond_to?(k) + end end end end end end