localytics / odbc_adapter

An ActiveRecord ODBC adapter
MIT License
46 stars 107 forks source link

Upgrade to rails 6 #39

Open Shehbaz opened 4 years ago

LiChoi commented 3 years ago

I pulled from this branch but it's not working for me (I'm using Rails 6.1.3.2). Whenever I try to query something on a table, this is the error I get

undefined method `ID' for #<Snowflake::Company:0x00007fe66381e650>
Did you mean?  id?
               id=
hle-skillz commented 3 years ago

I pulled from this branch but it's not working for me (I'm using Rails 6.1.3.2). Whenever I try to query something on a table, this is the error I get

undefined method `ID' for #<Snowflake::Company:0x00007fe66381e650>
Did you mean?  id?
               id=

Might be similar to issue we saw on Rails 5 trying to use ActiveModel localytics/odbc_adapter#33.

When following the instructions from the blog we had to add this to odbc.rb to change the id lookup in the adapter:

  # Possible bug with base adapter not fixing the case for primary key 'ID' in Snowflake.
  def primary_key(table_name)
    format_case(super || "ID")
  end