This repository has been archived on 2021-11-24. You can view files and clone it, but cannot push or open issues or pull requests.
phone_app/app/models/p_customer_rib.rb

14 lines
337 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