Class: ROM::AssociationSet

Inherits:
Registry show all
Defined in:
lib/rom/association_set.rb

Overview

Association set contains a registry with associations defined in schema DSL

Instance Attribute Summary

Attributes inherited from Registry

#cache, #elements

Instance Method Summary collapse

Methods inherited from Registry

[], build, #each, element_not_found_error, #fetch, #key?, #map, #merge, new, #respond_to_missing?, #to_hash, #type

Methods included from Initializer

extended

Constructor Details

#initializeAssociationSet

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AssociationSet.



12
13
14
15
16
17
# File 'lib/rom/association_set.rb', line 12

def initialize(*)
  super
  elements.values.each do |assoc|
    elements[assoc.name] = assoc if assoc.aliased? && !key?(assoc.name)
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ROM::Registry