Skip to content


has_one nested resource doesn't work #93

nirvdrum opened this Issue · 2 comments

2 participants


It looks like CanCan always assume a nested resource's parent has_many of the resource and structures its queries accordingly. As a result, nested has_one resources fail to load properly.


adding :singular option to support has_one associations in load/authorize resource - closed by 84f4c90


Once CanCan 1.3 is released you can use it like this.

class OrdersController < ActionController::Base
  load_and_authorize_resource :cart
  load_and_authorize_resource :order, :through => :cart, :singleton => true
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.