Sha256: fea2162c89f7e98bbe0589fa83c13cf1493827893bb405d942fafc0e11615328

Contents?: true

Size: 727 Bytes

Versions: 70

Compression:

Stored size: 727 Bytes

Contents

module ActiveFedora::Associations::Builder
  class HasMany < CollectionAssociation #:nodoc:
    def self.macro
      :has_many
    end

    def self.valid_options(options)
      super + [:as, :dependent, :inverse_of]
    end

    def self.valid_dependent_options
      [:destroy, :delete_all, :nullify, :restrict_with_error, :restrict_with_exception]
    end

    def self.define_readers(mixin, name)
      super

      mixin.redefine_method("#{name.to_s.singularize}_ids") do
        association(name).ids_reader
      end
    end

    def self.define_writers(mixin, name)
      super

      mixin.redefine_method("#{name.to_s.singularize}_ids=") do |ids|
        association(name).ids_writer(ids)
      end
    end
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
active-fedora-13.3.0 lib/active_fedora/associations/builder/has_many.rb
active-fedora-12.2.4 lib/active_fedora/associations/builder/has_many.rb
active-fedora-13.2.7 lib/active_fedora/associations/builder/has_many.rb
active-fedora-13.2.5 lib/active_fedora/associations/builder/has_many.rb
active-fedora-13.2.4 lib/active_fedora/associations/builder/has_many.rb
active-fedora-12.2.3 lib/active_fedora/associations/builder/has_many.rb
active-fedora-13.2.3 lib/active_fedora/associations/builder/has_many.rb
active-fedora-13.2.2 lib/active_fedora/associations/builder/has_many.rb
active-fedora-13.2.0 lib/active_fedora/associations/builder/has_many.rb
active-fedora-13.1.3 lib/active_fedora/associations/builder/has_many.rb
active-fedora-11.5.6 lib/active_fedora/associations/builder/has_many.rb
active-fedora-12.2.2 lib/active_fedora/associations/builder/has_many.rb
active-fedora-11.2.1 lib/active_fedora/associations/builder/has_many.rb
active-fedora-12.2.1 lib/active_fedora/associations/builder/has_many.rb
active-fedora-12.0.3 lib/active_fedora/associations/builder/has_many.rb
active-fedora-11.5.5 lib/active_fedora/associations/builder/has_many.rb
active-fedora-13.1.2 lib/active_fedora/associations/builder/has_many.rb
active-fedora-13.1.1 lib/active_fedora/associations/builder/has_many.rb
active-fedora-13.1.0 lib/active_fedora/associations/builder/has_many.rb
active-fedora-13.0.0 lib/active_fedora/associations/builder/has_many.rb