Can't create new user with ActiveAdmin

前端 未结 4 1826
南笙
南笙 2020-12-20 06:31

I just added active admin to my rails app and I\'m unable to create a new user. I am using the user model that active admin creates with a few added columns like first and

4条回答
  •  清酒与你
    2020-12-20 06:59

    This is to do with a code reloading bug in Rails which is manifested when your environment specifies config.cache_classes = false.

    Change that to true in your config/environments/development.rb, restart your server, and you should be able to create your user.

    However that's not ideal, and one workaround suggested here is to put the following in your config/environments/development.rb:

      config.to_prepare do
        Thread.current.keys.each{ |k| Thread.current[k] = nil if k.to_s =~ /_scoped_methods$/ }
      end
    

    Although the bug appears to be resolved, I see the issue in 3.1.1 which the above code fixes.

    Even though this is a bug in Rails, it's also logged as a bug in active_admin if you want to see more discussion on this.

提交回复
热议问题