Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DeeWBee committed Mar 5, 2019
1 parent ffe51dd commit fc842da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rolypoly/index_role_dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def apply_scopes
if scope_hash.keys.length == 1
scope_hash.inject(query) { |query, (scope_name, ids)| query.public_send(scope_name, ids) }
else
# This block is designed to handle cases of more than one scope.
# The following code has been demonstrated to perform on most "simple"...
#...objects and scopes. However, there are certain complex objects...
#...and scopes that cause permission checks to fail.
object_query = query
object_query = join_tables.inject(object_query) do |q, join_table|
q.joins(join_table)
Expand Down

0 comments on commit fc842da

Please sign in to comment.