Closed andrewculver closed 1 year ago
This line fails: https://github.com/bullet-train-pro/bullet_train-action_models/blob/main/lib/scaffolding/action_model_transformer.rb#L289
To reproduce, setup an app like so:
bin/super-scaffold crud Contact Team email:text_field first_name:text_field last_name:text_field bin/super-scaffold crud Newsletter Team name:text_field bin/super-scaffold join-model Newsletters::Subscription contact_id{class_name=Contact} newsletter_id{class_name=Newsletter} bin/super-scaffold crud-field Contact newsletter_ids:super_select{class_name=Newsletter} bin/super-scaffold crud Newsletters::Issue Newsletter,Team name:text_field body:text_area
You'll need to implement the valid_newsletters method of Contact in ./app/models/contact.rb:
valid_newsletters
Contact
./app/models/contact.rb
def valid_newsletters team.newsletters end
Then trigger the failure with this:
bin/super-scaffold action-model:targets-one Send Newsletters::Issue Newsletter,Team
This line fails: https://github.com/bullet-train-pro/bullet_train-action_models/blob/main/lib/scaffolding/action_model_transformer.rb#L289
To reproduce, setup an app like so:
You'll need to implement the
valid_newsletters
method ofContact
in./app/models/contact.rb
:Then trigger the failure with this: