Skip to content

Conversation

tatecarr
Copy link

@tatecarr tatecarr commented Aug 7, 2016

Versions after rails 4.1.5, the reflections keys became String rather than Symbol. It looks like they alternated between setting the key to a string as the value was set, and making the source of the key return a string (parent_reflection.name must return a string).

netsuite_rails uses Symbol for the local_field so this caused an issue when the field had a contructed value rather than a simple one (like a text field in NS).

Possibly should alter the way I've fixed this, but it tests to see if the first key of the reflections hash is a String or a Symbol and passes the local_field accordingly.

If the reflections hash is empty {} then {}.keys.first is nil, and the class = NilClass which is not a string and would then pass the Symbol. Which shouldn't matter since there are no keys to match against anyway. So seems like this would be a solid fix that bridges the gap between Symbol keys and String keys.

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

Successfully merging this pull request may close these issues.

1 participant