Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find(:all) and find(:first) ignore :cast=>true #193

Closed
mbklein opened this issue Aug 21, 2013 · 2 comments
Closed

find(:all) and find(:first) ignore :cast=>true #193

mbklein opened this issue Aug 21, 2013 · 2 comments

Comments

@mbklein
Copy link
Member

mbklein commented Aug 21, 2013

ActiveFedora::Base.find(conditions, :cast=>true) adapts the response to its first declared CModel. Principle of Least Surprise would expect ActiveFedora.find(:first, :cast=>true) and ActiveFedora.find(:all, :cast=>true) to do the same, but they don't.

@jcoyne
Copy link
Member

jcoyne commented Sep 16, 2013

ActiveFedora::Base.find(:all) is just a shortcut to ActiveFedora::Base.all, which is there to preserve backwards compatibility. ActiveFedora::Base.all should always cast to the appropriate cmodel.

I've deprecated the :all, :first, and :last options in this PR:
#201

@mbklein
Copy link
Member Author

mbklein commented Sep 19, 2013

Cool. +1

@mbklein mbklein closed this as completed Sep 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants