jbox-web / ajax-datatables-rails

A wrapper around DataTable's ajax methods that allow synchronization with server-side pagination in a Rails app
MIT License
584 stars 228 forks source link

1.3.0 breaks with uninitialized constant AjaxDatatablesRails::ActiveRecord::Base (NameError) #384

Closed thebravoman closed 3 years ago

thebravoman commented 3 years ago

Upgrading from 1.2 to 1.3

It breaks with

/home/kireto/.rvm/gems/ruby-2.6.5/gems/ajax-datatables-rails-1.3.0/lib/ajax-datatables-rails/base.rb:6:in `<class:Base>': uninitialized constant AjaxDatatablesRails::ActiveRecord::Base (NameError)
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/ajax-datatables-rails-1.3.0/lib/ajax-datatables-rails/base.rb:4:in `<module:AjaxDatatablesRails>'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/ajax-datatables-rails-1.3.0/lib/ajax-datatables-rails/base.rb:3:in `<top (required)>'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:26:in `require'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:26:in `require'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:409:in `const_get'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:409:in `block (2 levels) in eager_load'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:733:in `block in ls'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:725:in `foreach'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:725:in `ls'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:404:in `block in eager_load'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:393:in `synchronize'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:393:in `eager_load'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:508:in `each'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/loader.rb:508:in `eager_load_all'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/application/finisher.rb:122:in `block in <module:Finisher>'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/initializable.rb:32:in `instance_exec'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/initializable.rb:32:in `run'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/initializable.rb:61:in `block in run_initializers'
    from /home/kireto/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
    from /home/kireto/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    from /home/kireto/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
    from /home/kireto/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
    from /home/kireto/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each'
    from /home/kireto/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `call'
    from /home/kireto/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
    from /home/kireto/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
    from /home/kireto/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/initializable.rb:60:in `run_initializers'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/application.rb:363:in `initialize!'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/railtie.rb:190:in `public_send'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/railties-6.0.3.4/lib/rails/railtie.rb:190:in `method_missing'
    from /home/kireto/axles/code/fllcasts/config/environment.rb:10:in `<top (required)>'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/application.rb:106:in `preload'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/application.rb:157:in `serve'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
    from /home/kireto/.rvm/gems/ruby-2.6.5/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
    from /home/kireto/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/kireto/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

Not sure how I can resolve it. There is no info at https://github.com/jbox-web/ajax-datatables-rails/blob/master/doc/migrate.md

Using Rails 6

martingjaldbaek commented 3 years ago

Seems to be same issue as https://github.com/jbox-web/ajax-datatables-rails/pull/379 which is already merged, so it looks like the next release should fix it.

thebravoman commented 3 years ago

Thanks. Do you know if it would be 1.3.1 or 1.4 or 2.0 - so that we can prepare the proper Gemfile declaration? Do you know of any breaking changes that would be introduced in the next release?

n-rodriguez commented 3 years ago

Thanks. Do you know if it would be 1.3.1 or 1.4 or 2.0 - so that we can prepare the proper Gemfile declaration? Do you know of any breaking changes that would be introduced in the next release?

😄 it should be 1.3.1 with no breaking changes.

thebravoman commented 3 years ago

Thanks :)

n-rodriguez commented 3 years ago

Version 1.3.1 has been released : https://rubygems.org/gems/ajax-datatables-rails :rocket: