Actions
Defect #28243
closed
Principal.not_member_of scope does not accept ActiveRecord::Relation
Defect #28243:
Principal.not_member_of scope does not accept ActiveRecord::Relation
Resolution:
Affected version:
Description
Principal model has the following two scopes: member_of and not_member_of, both of them expect project or collection of projects as an argument. The problem is that given
you'll get correct results from , but an exception will be thrown if you'll try to run . That's because not_member_of puts its argument into an array if it's not a subclass of Array (which Project::ActiveRecord_Relation is not, though it knows how to #map).I think one should be able to call both member_of and not_member_of with any kind of project collection, not just Array, and both of them should process arguments in the same way. So I provide a patch for that.
Files
Actions