Sha256: 005b20063796182ffb1899626a8f9308a347acd951a4592ee626838ad946a5e8

Contents?: true

Size: 595 Bytes

Versions: 3

Compression:

Stored size: 595 Bytes

Contents

module Msip
  module Concerns
    module Models
      module Tclase
        extend ActiveSupport::Concern

        include Msip::Basica
        included do
          self.table_name = 'msip_tclase'
          has_many :clase, foreign_key: "id_tclase", validate: true, 
            class_name: 'Msip::Clase'

          validates :id, presence: true, allow_blank: false, 
            length: { maximum: 10}
          validates_uniqueness_of :id, case_sensitive: false

          def id=(val)
            self[:id] = val.upcase.squish if val
          end

        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
msip-2.2.0.alfa3 lib/msip/concerns/models/tclase.rb
msip-2.2.0.alfa2 lib/msip/concerns/models/tclase.rb
msip-2.2a2 lib/msip/concerns/models/tclase.rb