Singleton resource not loading 1.6 #310

Closed
spoptchev opened this Issue Mar 18, 2011 · 3 comments

Comments

Projects
None yet
2 participants
@spoptchev

I have a nested resource controller called (e.g.) books with the following cancan code:

load_and_authorize_resource :user
load_and_authorize_resource :book, :through => :user, :singleton => true

class User < AR
  has_one :book
end

I just switched from 1.5 to 1.6 and the @book instance variable is not set. Instead it loads all books into the @books instance variable. If I switch back to 1.5 it works as expected. Are there any code changes I'm not aware of?

@ryanb

This comment has been minimized.

Show comment
Hide comment
@ryanb

ryanb Mar 18, 2011

Owner

I made a change to load the @books collection when params[:id] isn't present, I think this is what is causing the problem. I'll look into a solution. Thanks for reporting this.

Owner

ryanb commented Mar 18, 2011

I made a change to load the @books collection when params[:id] isn't present, I think this is what is causing the problem. I'll look into a solution. Thanks for reporting this.

@ryanb

This comment has been minimized.

Show comment
Hide comment
@ryanb

ryanb Mar 18, 2011

Owner

fixing instance loading with :singleton option - closed by 7688025

Owner

ryanb commented Mar 18, 2011

fixing instance loading with :singleton option - closed by 7688025

@ryanb ryanb closed this Mar 18, 2011

@ryanb

This comment has been minimized.

Show comment
Hide comment
@ryanb

ryanb Mar 18, 2011

Owner

I just released 1.6.2 with this fix in it.

Owner

ryanb commented Mar 18, 2011

I just released 1.6.2 with this fix in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment