store_attribute
store_attribute copied to clipboard
Rails 8.1 object initialisation
Hi,
Here's the behaviour on Rails 8.0:
Loading staging environment (Rails 8.0.3)
e(staging)> a1 = AlliedHealthActivity.new(session_type: "INDI", specialist_type: "PSYC")
e(staging)> a1.session_type
=> "INDI"
e(staging)> a1.specialist_type
=> "PSYC"
Class definition:
class AlliedHealthActivity < ProfessionalServiceActivity
store_accessor :sti_store,
:ahpra_number,
:appointment_status,
:qualification_type,
:session_type,
:specialist_type,
:title,
:registration_number,
:services_delivered,
:qualification_details,
:authority_details,
:delivery_mode
(...)
Here's the behaviour on Rails 8.1:
Loading development environment (Rails 8.1.1)
[1] pry(main)> a1 = AlliedHealthActivity.new(session_type: "INDI", specialist_type: "PSYC")
[2] pry(main)> a1.session_type
=> nil
[3] pry(main)> a1.specialist_type
=> "PSYC"
There seems to be an override of sti_store that keeps the last field.
TIA.