Posted about 3 years ago. Visible to the public. Repeats.
ActiveType 1.2 supports "change_association"
With
ActiveType
Archive
1.2 you can modify associations (has_many
etc.) after they have been defined.
One common use case for this is to change an association inside a form model, like this:
Copyclass Credential < ActiveRecord::Base end class User < ActiveRecord::Base has_many :credentials end class SignUpCredential < ActiveType::Record[Credential] end class SignUp < ActiveType::Record[User] change_association :credentials, class_name: 'SignUpCredential' end
Now, if you load credentials
, you will automatically receive records of type SignUpCredential
.
Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for unsupported versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2).