method
construct
v3.2.1 -
Show latest stable
-
0 notes -
Class: JoinDependency
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0 (0)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (0)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
construct(parent, associations, join_parts, row)
protected
Hide source
# File activerecord/lib/active_record/associations/join_dependency.rb, line 155 def construct(parent, associations, join_parts, row) case associations when Symbol, String name = associations.to_s join_part = join_parts.detect { |j| j.reflection.name.to_s == name && j.parent_table_name == parent.class.table_name } raise(ConfigurationError, "No such association") unless join_part join_parts.delete(join_part) construct_association(parent, join_part, row) when Array associations.each do |association| construct(parent, association, join_parts, row) end when Hash associations.sort_by { |k,_| k.to_s }.each do |association_name, assoc| association = construct(parent, association_name, join_parts, row) construct(association, assoc, join_parts, row) if association end else raise ConfigurationError, associations.inspect end end