I have:
Class User < ActiveRecord::Base
has_one :default_permission
end
class DefaultPermission < ActiveRecord::Base
belongs_to :user
belongs_to :permission
end
class Permission < ActiveRecord::Base
has_many :default_permissions
end
Which is the easiest way to get default permissions for a specific user?
Using a scope? Or can I do something like user.defaultpermission.permissions ??
Thanks
If you have the data correctly stored, this will work:
this seems complicated thought — it might be a sign your design is flawed.