Skip to content

Create reference generator#84

Open
tragiclifestories wants to merge 1 commit intomasterfrom
reference-generator
Open

Create reference generator#84
tragiclifestories wants to merge 1 commit intomasterfrom
reference-generator

Conversation

@tragiclifestories
Copy link
Copy Markdown

No description provided.

@tragiclifestories tragiclifestories requested a review from a team March 24, 2020 18:31
Comment on lines +393 to +398
```
rails generate nandi:reference foos bar

create db/safe_migrations/20190424123727_add_reference_on_foos_to_bar.rb
create db/safe_migrations/20190424123728_index_foos_on_bar_id_bar_type.rb
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks the same as the above. did you miss the --polymorphic flag?

Comment on lines +14 to +21
Example:
rails generate nandi:reference foos bar --polymorphic

Create a bar_id and bar_type column on foos and index them.

This will create:
db/safe_migrations/20190424123727_add_reference_bar_to_foos.rb
db/safe_migrations/20190424123728_index_foos_on_bar_id_bar_type.rb
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely clear what polymorphic references mean in Rails / Postgres terms TBH.. 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants