bullet_train
bullet_train copied to clipboard
Create a `has_one` Super Scaffolding template.
+1
Considering tackling this one next
Before moving forward, I wonder if it would be beneficial to make a ReflectionBuilder
class. That way we could extract some code out of the Transformer and refactor the code where belongs_to
, has_many
, and has_one
overlap.
In the future (if needed), we could potentially add support for composed_of
as well.
https://github.com/rails/rails/blob/218ec10df8ec9a84a5090b5c2b985dfcd8e7b820/activerecord/lib/active_record/reflection.rb#L33-L46
Rails has an ActiveRecord::Associations::Builder with the different associations in the same directory, but I think this is inherently different from what we want to do (build the line that goes in the model).
Maybe could use a different name (ReflectionLineBuilder
).