basic_dem_app/app/models/p_customer_rib.rb
Nicolas Bally 3524d4c862 intial
2020-03-18 15:49:29 +01:00

14 lines
335 B
Ruby

class PCustomerRib < ActiveRecord::Base
belongs_to :p_customer
has_many :p_documents, :dependent => :nullify
def generate_rum
if self.sign_date
self.rum = "JOA"+self.p_customer.ref.to_s+self.sign_date.year.to_s+('%02d' % self.sign_date.month)+('%02d' % self.sign_date.day)
self.save
end
end
end