Sha256: b69798b95b6458de1612bf724fcd79fc2afcf2d2c19d66ca1351b50c24e7c568

Contents?: true

Size: 559 Bytes

Versions: 22

Compression:

Stored size: 559 Bytes

Contents

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

          # Associations
          base.send :belongs_to, :abstractor_section_type
          base.send :has_many, :abstractor_section_name_variants
        end

        def prepare_section_name_variants
          section_name_variants.join('|')
        end

        def section_name_variants
          [name].concat(abstractor_section_name_variants.map(&:name))
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
abstractor-4.4.7 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.4.6 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.4.5 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.4.4 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.4.3 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.4.2 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.4.1 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.4.0 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.3.3 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.3.2 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.3.1 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.3.0 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.2.3 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.2.2 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.2.1 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.2.0 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.1.5 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.1.4 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.1.3 lib/abstractor/methods/models/abstractor_section.rb
abstractor-4.1.2 lib/abstractor/methods/models/abstractor_section.rb