We're no longer using the As naming convention when extending models with ActiveType::Record[User]. Instead just pick whatever substantive best describes the extended class. Note that we prefer the verbose notation of parent namespaces and classes - also for specs:
class User
class RegistrationForm < ActiveType::Record[User]
...
end
end
Talk with your mentor about the motivations behind the use of form models.
Exercises
Go through the repos of Cards and/or MovieDB and apply what you learned:
Create a form model backed by a database
Have two different forms to create a user: One for public sign up, one in a private admin area
The sign up form sends a welcome e-mail and checks for password policy, the admin form doesn't.
If you are struggling with this, just have a method send_welcome_email that does nothing. If time allows, try changing this to send a simple e-mail once you are done with everything else in this card.
Implement the public sign up form once as an ActiveType::Object and once as an ActiveType::Record[User]. What are the pros and cons of each approach?
Create a form model not backed by a database
Implement the login form using ActiveType::Object
Implement a screen to merge two movies.
Flat attributes are copied from the source movie if it is missing on the target movie.
The poster is copied from the source movie if the target movie has no poster yet.
Lists of actors are merged, but actors found in both lists are only kept once.
Showtimes are merged as well (hint: this is easier than merging actors), discarding duplicates.
The first movie is destroyed after successfully merging into the second movie.
Find and talk about examples where a method should better live in a callback and vice versa
Find a composition of classes and move the child classes into the namespace of the container class.