Sha256: faccc91f1d7e80b84b659797d28f80b0a315e2ad15e6a17a556da0a78e2de899

Contents?: true

Size: 1.73 KB

Versions: 8

Compression:

Stored size: 1.73 KB

Contents

# Generated via
#  `rails generate common_repository_model::collection <%= class_name %>`
require 'common_repository_model/collection'
class <%= class_name %> < CommonRepositoryModel::Collection

  # ***************************************************************************
  # ***************************************************************************
  # NOTE: When managing associations, there is a bug in the underlying
  #   has_and_belongs_to_many. To remove an item from the association, you
  #   will presently need to operate on the child object – that is the object
  #   with the RELS-EXT entry.
  #   use `object.remove_from_containers(a_container)`
  # ***************************************************************************
  # ***************************************************************************
  #
  # EXAMPLE OF .has_members && .is_member_of
  # Creates a relationship in which the RELS-EXT entries are stored in the
  # "child" object. By using the has_members and is_member_of, the RELS-EXT
  # also has an "isMemberOf" entry. In this way, we can generically walk the
  # document tree as we know a related object exists.
  #
  # has_members :children, type: "<%= class_name %>" , property: 'is_named_member_of'
  # is_member_of :parents, type: "<%= class_name %>" , property: 'is_named_member_of'
  #
  # In this case, a Page object would have the RELS-EXT entry
  # has_members :pages, type: "Page", property: "is_page_of"
  #
  # In this case, the <%= class_name %> object would have the RELS-EXT entry
  # is_member_of :containers, type: "Container", property: "is_contained_in"
  #
  # For Examples Specs:
  # https://github.com/ndlib/common_respository_model/blob/master/spec/common_respository_model/integration_spec.rb
  #

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
common_repository_model-0.0.8 lib/generators/common_repository_model/collection/templates/collection.rb.erb
common_repository_model-0.0.7 lib/generators/common_repository_model/collection/templates/collection.rb.erb
common_repository_model-0.0.6 lib/generators/common_repository_model/collection/templates/collection.rb.erb
common_repository_model-0.0.5 lib/generators/common_repository_model/collection/templates/collection.rb.erb
common_repository_model-0.0.4 lib/generators/common_repository_model/collection/templates/collection.rb.erb
common_repository_model-0.0.3 lib/generators/common_repository_model/collection/templates/collection.rb.erb
common_repository_model-0.0.2 lib/generators/common_repository_model/collection/templates/collection.rb.erb
common_repository_model-0.0.1 lib/generators/common_repository_model/collection/templates/collection.rb.erb