Sha256: b4874de1cec84d961d666f1e8db46f0ed10272e556d3df1425794ba738b6c2d2
Contents?: true
Size: 961 Bytes
Versions: 22
Compression:
Stored size: 961 Bytes
Contents
Description: Generate migrations and models based on ActiveRecord association types. Use the model class name. Example: rails g mdwa:association Library has_many Books rails g mdwa:association Book belongs_to Library --with-opposite Generates the first example as the opposite rails g mdwa:association Company nested_one Address Creates address_id in migration and belongs_to :address and accepts_nested_attrs in Company model Creates has_one :company in Address model if opposite requested rails g mdwa:association Sale nested_many SaleItem Creates sale_id and belongs_to in SaleItem Creates has_many and accepts_nested_attrs in Sale rails g mdwa:association User has_and_belongs_to_many Project Creates the join table projects_users Creates has_and_belongs_to_many association in both models The generated code indicates the join_table parameter, because often users have many to many associations and may be inheritance involved.
Version data entries
22 entries across 22 versions & 1 rubygems