You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the sql query returns a column named 'class', the CartoDB::Client::Utils.parse_json breaks on line 10: json = ::JSON.parse(response.body, :object_class => CartoDB::Types::Metadata, :symbolize_names => true)
Looks like it's because CartoDB::Types::Metadata defines a method for each column name on itself, which means it then overwrites it's own class variable:
# cartodb/types/metadata.rb:23# if key is 'class', we just overwrote self.class :-Sself.class.send:define_method,"#{key}"doself[key.to_sym]end
Probably means there are problems with other ruby reserved words?
The text was updated successfully, but these errors were encountered:
Indeed, the ruby client can't handle cartodb column named with ruby reserved words.
I've just pushed a patch with a workaround to this issue: it adds an underscore to the end of each column name matching a ruby reserved word. But just when retreiving data from the database.
Please, let me know if this solves your problem to close this issue.
If the sql query returns a column named 'class', the CartoDB::Client::Utils.parse_json breaks on line 10:
json = ::JSON.parse(response.body, :object_class => CartoDB::Types::Metadata, :symbolize_names => true)
Looks like it's because CartoDB::Types::Metadata defines a method for each column name on itself, which means it then overwrites it's own class variable:
Probably means there are problems with other ruby reserved words?
The text was updated successfully, but these errors were encountered: