-
Notifications
You must be signed in to change notification settings - Fork 5
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
Ability to use Active Record class methods #19
Comments
Did you want to raise an Also, the dynamic finder methods appear to be mildly deprecated. Why use them instead of the AREL style? |
@sskirby yes, we want the NotFound exception so our controllers return 404s. Right now we are reimplementing that behaviour in our repos, but having this in Vorpal/AR would be an enhancement and will lower the bar to use Vorpal. We don't want to use dynamic finders (e.g. |
I'm sure we can come up with something to make the your I'm curious why you would like to use |
|
We like how, by using the Vorpal Mapper, we can use AR methods like
#where
inside a repo. We'd like the ability to use other methods like#find
or#find_by
as well, but these methods return an AR object instead of an ActiveRecord::Relation object, and that AR object does not have the usefulload_one
method.Here is an example
This method:
Crashes with the following error:
We want to use
find
because we want to raise a NoError exception if the record does not exist.The text was updated successfully, but these errors were encountered: