When using an existing scope, it should be merged properly to the class. May fix ryanb/cancan#328 :)

This commit is contained in:
Florent Piteau
2011-04-01 21:25:19 +02:00
parent 81f00f9024
commit a10243a569
2 changed files with 2 additions and 2 deletions
@@ -87,7 +87,7 @@ module CanCan
def database_records
if override_scope
override_scope
@model_class.scoped.merge(override_scope)
elsif @model_class.respond_to?(:where) && @model_class.respond_to?(:joins)
@model_class.where(conditions).joins(joins)
else