You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AFAIU unscoped behaviour will be default one in 6.1, but right now there is no way to force it, so deprecation warning is essentially unfixable.
See brendon/acts_as_list#363 for example.
# frozen_string_literal: truerequire"bundler/inline"gemfile(true)dosource"https://rubygems.org"git_source(:github){ |repo| "https://github.com/#{repo}.git"}gem"rails",github: "rails/rails"gem"sqlite3"endrequire"active_record"require"minitest/autorun"require"logger"# This connection will do for database-independent bug reports.ActiveRecord::Base.establish_connection(adapter: "sqlite3",database: ":memory:")ActiveRecord::Base.logger=Logger.new(STDOUT)ActiveRecord::Schema.definedocreate_table:posts,force: truedo |t|
t.text:textendendclassPost < ActiveRecord::Baseafter_save:acts_as_listdefacts_as_listPost.unscope(:where)endendActiveSupport::Deprecation.behavior=:raiseclassBugTest < Minitest::Testdeftest_association_stuffPost.find_or_create_by!(text: 'text')endend
Expected behavior
No deprecation warning
Actual behavior
ActiveSupport::DeprecationException: DEPRECATION WARNING: Class level methods will no longer inherit scoping from create!in Rails 6.1. To continue using the scoped relation, pass it into the block directly. To instead access the full set of models, as Rails 6.1 will, usePost.unscoped, or Post.default_scoped if a model has default scopes. (called from acts_as_list at active_record_master.rb:32)
System configuration
Rails version: 6.0 or git master
Ruby version: 2.6.5
The text was updated successfully, but these errors were encountered:
Steps to reproduce
AFAIU
unscoped
behaviour will be default one in 6.1, but right now there is no way to force it, so deprecation warning is essentially unfixable.See brendon/acts_as_list#363 for example.
Expected behavior
No deprecation warning
Actual behavior
ActiveSupport::DeprecationException: DEPRECATION WARNING: Class level methods will no longer inherit scoping from
create!in Rails 6.1. To continue using the scoped relation, pass it into the block directly. To instead access the full set of models, as Rails 6.1 will, use
Post.unscoped, or
Post.default_scopedif a model has default scopes. (called from acts_as_list at active_record_master.rb:32)
System configuration
Rails version: 6.0 or git master
Ruby version: 2.6.5
The text was updated successfully, but these errors were encountered: