store_attribute icon indicating copy to clipboard operation
store_attribute copied to clipboard

Rails 8.1 object initialisation

Open msxavi opened this issue 2 weeks ago • 0 comments

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.

msxavi avatar Dec 16 '25 23:12 msxavi