Nested controller, with nested model

5 views
Skip to first unread message

Kris

unread,
Feb 20, 2012, 12:27:52 PM2/20/12
to declarative_authorization
Given the following

class Studies::Reports < ApplicationController
filter_resource_access :nested_in => :studies

class Study < AR::Base
has_many :reports

class Study::Report < AR::Base
belongs_to :study

NameError (uninitialized constant Report):
in_controller.rb:138:in `load_controller_object'
in_controller.rb:495:in `send'
in_controller.rb:495:in `filter_resource_access'

Is there any way to have delc_auth use Study::Report instead of
Report?

The only way I have found so far is a hack such as:

class Report < Study::Report; end

Rails 2.3.5
decl_auth 0.4.1

Many thanks, K.
Reply all
Reply to author
Forward
0 new messages