Sha256: b40be8274c424f4607ff29626ce827beb2fef154b62618d48c4dba90aeed167e

Contents?: true

Size: 565 Bytes

Versions: 3

Compression:

Stored size: 565 Bytes

Contents

# frozen_string_literal: true

module Clowne
  module Declarations
    class ExcludeAssociation < Base # :nodoc: all
      attr_accessor :name

      def initialize(name, **)
        @name = name.to_sym
      end

      def compile(plan)
        plan.remove_from(:association, name)
      end
    end
  end
end

Clowne::Declarations.add :exclude_association, Clowne::Declarations::ExcludeAssociation
Clowne::Declarations.add :exclude_associations do |*names|
  names.each do |name|
    declarations.push Clowne::Declarations::ExcludeAssociation.new(name)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
clowne-1.5.0 lib/clowne/declarations/exclude_association.rb
clowne-1.4.0 lib/clowne/declarations/exclude_association.rb
clowne-1.3.0 lib/clowne/declarations/exclude_association.rb