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:

Copy
class 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.

Your development team has a full backlog of feature requests, chores and refactoring coupled with deadlines? We are familiar with that. With our "DevOps as a Service" offering, we support developer teams with infrastructure and operations expertise.

Owner of this card:

Avatar
Tobias Kraze
Last edit:
22 days ago
by Jakob Scholz
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Tobias Kraze to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more