search for: generate_constrain

Displaying 1 result from an estimated 1 matches for "generate_constrain".

2006 Jun 28
2
[PATCH] Bug fixes and additions to scoped_access
...6-27 19:00:26.755869000 -0700 +++ vendor/plugins/scoped_access/lib/scoped_access.rb 2006-06-27 18:33:57.297418000 -0700 @@ -114,12 +114,20 @@ end def before (controller) - @scoping = controller.instance_eval(@scoping.to_s) if @scoping.is_a?(Symbol) - constrain = self.class.generate_constrain(@klass, @scoping, :table_name =>@klass.table_name) + if @scoping.is_a? Symbol + meth = controller.method @scoping + if meth.arity.zero? + scope = controller.instance_eval(@scoping.to_s) + else + scope = controller.instance_eval("#{@scoping}(#{@klass})...