lib/by_star/base.rb in by_star-2.2.0 vs lib/by_star/base.rb in by_star-2.2.1
- old
+ new
@@ -36,11 +36,13 @@
def by_star_scope(options={})
scope = options[:scope] || @by_star_scope || self
if scope.is_a?(Proc)
if scope.arity == 0
return instance_exec(&scope)
+ elsif options[:scope_args]
+ return instance_exec(*Array(options[:scope_args]), &scope)
else
- return instance_exec(self, &scope)
+ raise 'ByStar :scope does not accept arguments'
end
else
return scope
end
end