Sha256: 7f883f23f788e219b5e6c8a30aafe31e57f825bf00358af82475360af4f790aa

Contents?: true

Size: 785 Bytes

Versions: 14

Compression:

Stored size: 785 Bytes

Contents

module Abstractor
  module Methods
    module Models
      module AbstractorSubjectGroup
        def self.included(base)
          base.send :include, SoftDelete

          # Associations
          base.send :has_many, :abstractor_subject_group_members
          base.send :has_many, :abstractor_subjects, :through => :abstractor_subject_group_members
          base.send :has_many, :abstractor_abstraction_groups
          base.send :has_many, :abstractor_abstractions, :through => :abstractor_abstraction_groups

          # base.send :attr_accessible, :deleted_at, :name
          # Validations
          base.send :validates, :cardinality, numericality: { only_integer: true, greater_than: 0 }, unless: Proc.new { |a| a.cardinality.blank? }
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
abstractor-4.3.3 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.3.2 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.3.1 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.3.0 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.2.3 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.2.2 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.2.1 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.2.0 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.1.5 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.1.4 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.1.3 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.1.2 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.1.1 lib/abstractor/methods/models/abstractor_subject_group.rb
abstractor-4.1.0 lib/abstractor/methods/models/abstractor_subject_group.rb