Skip to content

Commit

Permalink
Let rails figure out which fields to select
Browse files Browse the repository at this point in the history
  • Loading branch information
Taeir authored Feb 23, 2022
1 parent 0c883f4 commit 27cb176
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/rolify/adapters/active_record/resource_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def resources_find(roles_table, relation, role_name)
resources = relation.joins("INNER JOIN #{quote_table(roles_table)} ON #{quote_table(roles_table)}.resource_type IN (#{relations}) AND
(#{quote_table(roles_table)}.resource_id IS NULL OR #{quote_table(roles_table)}.resource_id = #{quote_table(relation.table_name)}.#{quote_column(relation.primary_key)})")
resources = resources.where("#{quote_table(roles_table)}.name IN (?) AND #{quote_table(roles_table)}.resource_type IN (?)", Array(role_name), klasses)
resources = resources.select("#{quote_table(relation.table_name)}.*")
resources
end

Expand Down

0 comments on commit 27cb176

Please sign in to comment.