Sha256: 54b06687920ada9f555affcd92a2fb544e0be3fa7f062edc04c60076f5c7dfe0

Contents?: true

Size: 374 Bytes

Versions: 7

Compression:

Stored size: 374 Bytes

Contents

require_relative 'entity_node'

module Spectifly
  module Base
    class Association < EntityNode
      attr_reader :relationship

      def initialize(field_name, options = {})
        super
        @relationship = options.delete(:relationship)
      end

      def multiple?
        ['has_many', 'has_many_and_belongs_to'].include? relationship
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spectifly-0.0.7 lib/spectifly/base/association.rb
spectifly-0.0.6 lib/spectifly/base/association.rb
spectifly-0.0.5 lib/spectifly/base/association.rb
spectifly-0.0.4 lib/spectifly/base/association.rb
spectifly-0.0.3 lib/spectifly/base/association.rb
spectifly-0.0.2 lib/spectifly/base/association.rb
spectifly-0.0.1 lib/spectifly/base/association.rb