Granting permission to a model w/o reverse relationship definitions

4 views
Skip to first unread message

Edward Rudd

unread,
Mar 29, 2012, 11:34:50 AM3/29/12
to declarative_...@googlegroups.com
Here is the scenario.

class Facility < ActiveRecord::Base
    belongs_to :address
    belongs_to :classified_address, :class_name => 'Address'
end

class Address < ActiveRecord::Base
# just fields and an ID,  NON-polymorphic
end

The question How do I grant access to manage the addresses that are associated with the facility?  Putting has_many on the address seems very unscalable as we have other models with belong_to an address.  Using polymorphic doesn't work either as we have different "types" of addresses (as seen in this example).

Any thoughts would be greatly appreciated..  
Reply all
Reply to author
Forward
0 new messages