byroot / activerecord-typedstore

ActiveRecord::Store but with type definition
MIT License
437 stars 57 forks source link

super: no superclass method `extract_default' #64

Open DLawla opened 6 years ago

DLawla commented 6 years ago

Hi there, I'm seeing an issue when jumping to edge rails (6.0.0.alpha) from 5.2.0.rc1 which you may be already aware of: super: no superclass method `extract_default' for #<ActiveRecord::TypedStore::Column:0x00007f9582c27c88>

We have a model with JSON column, defined as follows in the model:

typed_store :metadata, coder: JSONCoder do |p|
    p.integer :foo
 end

JSONCoder is copy-paste of the DumbCoder in the Readme:

module JSONCoder
  extend self

  def load(data)
    data || {}
  end

  def dump(data)
    data || {}
  end
end

Ruby: 2.5.0

I had a quick dig and get a little overwhelmed. Happy hear your thoughts on this. Cheers!

rafaelfranca commented 6 years ago

Do you have the entire backtrace? That can help us to find where that method is being called.

rafaelfranca commented 6 years ago

Ah, I see what is happening. Since this gem don't support Rails 6 yet, bundle may had downgraded you to an incompatible version. ActiveRecord::TypedStore::Column don't exist anymore in the current version.

DLawla commented 6 years ago

Ah okay, good to know. Glad you are aware of this then.

DLawla commented 6 years ago

@rafaelfranca, do you have an idea when we could expect Rails 6 support?

rafaelfranca commented 6 years ago

Not really, Rails 6 code right now is almost the same as 5.2, so there is no rush for us to support. But maybe in a few weeks we will add support.

TheMindlessDev commented 5 years ago

Support for rails 6 would be great! I'm working on a project with rails 6 that relies heavily on this gem.. its gonna be a beast to refactor the project.. Do you have any ideas on a timeline for rails 6 compatibility?