Skip to content

Commit ae0c87f

Browse files
committed
Use updated JR branch which merges records on joins
1 parent fba3a64 commit ae0c87f

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
44
gem(
55
'jsonapi-resources',
66
git: 'https://github.com/cerebris/jsonapi-resources.git',
7-
branch: 'track_join_options'
7+
branch: 'use_records_for_joined_resources'
88
)
99

1010
gemspec

lib/jsonapi/authorization/pundit_scoped_resource.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ def records(options = {})
1010
user_context = JSONAPI::Authorization.configuration.user_context(options[:context])
1111
::Pundit.policy_scope!(user_context, super)
1212
end
13-
14-
def apply_joins(records, join_manager, options)
15-
records = super
16-
join_manager.join_details.each do |k, v|
17-
next if k == '' || v[:join_type] == :root
18-
v[:join_options][:relationship_details][:resource_klasses].each_key do |klass|
19-
next unless klass.included_modules.include?(PunditScopedResource)
20-
records = records.where(v[:alias] => { klass._primary_key => klass.records(options)})
21-
end
22-
end
23-
records
24-
end
2513
end
2614
end
2715
end

0 commit comments

Comments
 (0)