basic_app/app/models/m_odr_rep_rib.rb
Nicolas Bally fd027c16c1 initial
2020-04-21 21:53:16 +02:00

33 lines
851 B
Ruby

class MOdrRepRib < ApplicationRecord
belongs_to :admin
belongs_to :p_customer
belongs_to :m_odr_rep
has_one :m_odr, :through => :m_odr_rep
validates :bic, :presence => true, length: { in: 8..11 }
validates :iban, :presence => true
validates_with IbanValidator
has_many :mail_hists, :as => :element
acts_as_sorting :fields => {
:id => {:name => "Id", :reorder => true},
:p_customer => {:name => "Utilisateur"},
:iban => {:name => "IBAN", :reorder => true},
:bic => {:name => "BIC", :reorder => true},
:admin_ok => {:name => "Décision", :reorder => true},
:reject_reason => {:name => "Raison du rejet", :reorder => true},
:reject_reason_description => {:name => "Raison du rejet : commentaire", :reorder => true},
:actions => {:name => "Actions", :reorder => true},
}
end