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

Version Path
mdd-3.1.4 lib/generators/mdwa/association/USAGE
mdd-3.1.2 lib/generators/mdwa/association/USAGE
mdd-3.1.1 lib/generators/mdwa/association/USAGE
mdd-3.1.0 lib/generators/mdwa/association/USAGE
mdd-3.0.20 lib/generators/mdwa/association/USAGE
mdd-3.0.19 lib/generators/mdwa/association/USAGE
mdd-3.0.18 lib/generators/mdwa/association/USAGE
mdd-3.0.17 lib/generators/mdwa/association/USAGE
mdd-3.0.16 lib/generators/mdwa/association/USAGE
mdd-3.0.15 lib/generators/mdwa/association/USAGE
mdd-3.0.14 lib/generators/mdwa/association/USAGE
mdd-3.0.13 lib/generators/mdwa/association/USAGE
mdd-3.0.10 lib/generators/mdwa/association/USAGE
mdd-3.0.9 lib/generators/mdwa/association/USAGE
mdd-3.0.8 lib/generators/mdwa/association/USAGE
mdd-3.0.7 lib/generators/mdwa/association/USAGE
mdd-3.0.6 lib/generators/mdwa/association/USAGE
mdd-3.0.4 lib/generators/mdwa/association/USAGE
mdd-3.0.3 lib/generators/mdwa/association/USAGE
mdd-3.0.2 lib/generators/mdwa/association/USAGE