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

Specifying value as a :symbol does not work, despite code documentation #550

Closed
tlrdstd opened this issue Aug 3, 2017 · 1 comment
Closed

Comments

@tlrdstd
Copy link

tlrdstd commented Aug 3, 2017

https://github.com/toptal/chewy/blob/master/lib/chewy/type/mapping.rb#L59-L70 states:

# :value might be a proc or indexed object method name:
field :full_name, type: 'string', value: :user_full_name

However, the code at https://github.com/toptal/chewy/blob/master/lib/chewy/fields/base.rb#L34-L54 does not support this. Specifically, if value is not a Proc, then the code calls object.send(name), when I would have expected it to call object.send(value) if value is a Symbol.

https://github.com/toptal/chewy/blob/master/lib/chewy/fields/base.rb#L53

Possibly related to #549, though I have not examined the diff in depth.

@pyromaniac
Copy link
Contributor

Oh, you are right, will fix it, thanks for the report!

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