-
Notifications
You must be signed in to change notification settings - Fork 1
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
Raise UnknownAttributeError
if .where
is given invalid attribute names
#80
Raise UnknownAttributeError
if .where
is given invalid attribute names
#80
Conversation
.where
UnknownAttributeError
if .where
is given invalid attribute names
raise ArgumentError, 'field is required' if field.blank? | ||
raise ArgumentError, "field '#{field}' does not exist on #{sobject}" unless mappings.key?(field.to_sym) | ||
raise UnknownFieldError.new(sobject, field) unless mappings.key?(field.to_sym) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seemed appropriate to change this as well, since it's basically the same thing.
@@ -1,12 +1,17 @@ | |||
require 'spec_helper' | |||
|
|||
class TestSObject < ActiveForce::SObject | |||
def self.decorate(records) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a spec failing below when I changed sobject
to a class_double
because ActiveForce::SObject
does not implement .decorate
. I see that this method is supposed to be something that the consumer would implement in their subclass. This seems like a weird pattern to use with class methods. In any case, this seemed like the least intrusive workaround so that we can get a class_double
here that validates that this mock matches real methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I never fully understood why the original authors of this library did something like that but I guess we're stuck with it for now. 🤷
…itted-from-the-generated-query
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! Will leave it open for a bit to see if anyone else chimes in.
Closes #26