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
I have found some behavior changes as a result of updating from 2.7.0 to 2.8.0.
When assigning to a field using enum key, the value is no longer set, is this the expected behavior?
It just seemed like a bug to me....
# frozen_string_literal: truerequire"bundler/inline"gemfile(true)dosource"https://rubygems.org"gem"rails"# If you want to test against edge Rails replace the previous line with this:# gem "rails", github: "rails/rails", branch: "main"gem"sqlite3","~> 1.4"gem"enumerize","2.8.0"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:samples,force: truedo |t|
t.integer:codeendendclassSample < ActiveRecord::BaseextendEnumerizeenumerize:code,in: {initial: 1,start: 2,finish: 3,}endclassBugTest < Minitest::Testdeftest_enum_assignmentsample=Sample.newsample["code"]="start"assert_equal"start",sample.codeendend
I have found some behavior changes as a result of updating from
2.7.0
to2.8.0
.When assigning to a field using enum key, the value is no longer set, is this the expected behavior?
It just seemed like a bug to me....
2.7.0
2.8.0
The following commit seems to have affected this.
018c5a4
enumerize/lib/enumerize/activerecord.rb
Line 119 in 018c5a4
The text was updated successfully, but these errors were encountered: