lib/jsonapi/active_relation/join_manager.rb in jsonapi-resources-0.10.5 vs lib/jsonapi/active_relation/join_manager.rb in jsonapi-resources-0.10.6
- old
+ new
@@ -145,13 +145,19 @@
relationship = join_details[:relationship]
relationship_details = join_details[:relationship_details]
related_resource_klass = join_details[:related_resource_klass]
join_type = relationship_details[:join_type]
+ join_options = {
+ relationship: relationship,
+ relationship_details: relationship_details,
+ related_resource_klass: related_resource_klass,
+ }
+
if relationship == :root
unless source_relationship
- add_join_details('', {alias: resource_klass._table_name, join_type: :root})
+ add_join_details('', {alias: resource_klass._table_name, join_type: :root, join_options: join_options})
end
next
end
records, join_node = self.class.get_join_arel_node(records, options) {|records, options|
@@ -161,10 +167,10 @@
join_type: join_type,
relationship: relationship,
options: options)
}
- details = {alias: self.class.alias_from_arel_node(join_node), join_type: join_type}
+ details = {alias: self.class.alias_from_arel_node(join_node), join_type: join_type, join_options: join_options}
if relationship == source_relationship
if relationship.polymorphic? && relationship.belongs_to?
add_join_details("##{related_resource_klass._type}", details)
else
\ No newline at end of file