Closed radicaled closed 8 years ago
Just tried. It works. Probably a problem with the Spring preloader.
I just restarted Spring and I'm seeing the same thing.
I'm on Rails 5.0 beta2 (gem 'rails', '>= 5.0.0.beta2', '< 5.1'
) -- I didn't see any notes in the CHANGELOG about changes to before_save
though.
This repo reproduces my error: https://github.com/radicaled/nobrainer_error
The first commit is bog-standard Rails 5.0 generation, the second commit -- https://github.com/radicaled/nobrainer_error/commit/4d03763f457c82939363d4f97fe94b55077d62d2 -- is the code I've added.
arron@XXXG-SHENLONG ~/Projects/nb-bug [18:45:07]
> $ bin/spring stop ⬡ 3.1.0 [±master]
Spring stopped.
arron@XXXG-SHENLONG ~/Projects/nb-bug [18:45:08]
> $ rails c ⬡ 3.1.0 [±master]
Running via Spring preloader in process 7827
Loading development environment (Rails 5.0.0.beta2)
2.3.0 :001 > Derp.new.save
[NoBrainer] ActiveRecord is loaded which is probably not what you want.
[NoBrainer] Follow the instructions on http://nobrainer.io/docs/configuration/#removing_activerecord
[NoBrainer] Configure NoBrainer with 'config.warn_on_active_record = false' to disable with warning.
Connected to rethinkdb://localhost:28015/nb_bug_development
[ 7.7ms] r.table("derps").insert({"id" => "31B9aFk2PXVhMR"})
=> true
2.3.0 :002 >
I can reproduce the problem.
Let me see...
The issue was introduced with the new callback behavior: http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#halting-callback-chains-via-throw-abort
Fixed :)
Verified working now, thanks!
Defining
is equally disappointing, in that nothing happens.