Generated migrations pluralize table names when ActiveRecord::Base.pluralize_table_names == false #13426

Closed
samsonjs opened this Issue Dec 20, 2013 · 2 comments

2 participants

@samsonjs

Model generators get it right so it might be an easy fix. Might be as easy as inheriting from NamedBase instead of Base? The problem lies in https://github.com/rails/rails/blob/master/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb#L21-L38

@kuldeepaggarwal kuldeepaggarwal added a commit to kuldeepaggarwal/rails that referenced this issue Dec 21, 2013
@kuldeepaggarwal kuldeepaggarwal fixes #13426
generating proper migration when ActiveRecord::Base.pluralize_table_names = false
847abe8
@samsonjs

Wow, you are on top of this. Thanks for the quick response! 🍻

@JonRowe

Did this ever get a review? /cc @josevalim @jonleighton @rafaelfranca etc?

@kuldeepaggarwal kuldeepaggarwal added a commit to kuldeepaggarwal/rails that referenced this issue Mar 25, 2014
@kuldeepaggarwal kuldeepaggarwal Fixes #13426.
    Fix Generation of proper migration when
    ActiveRecord::Base.pluralize_table_names = false.

    Previously, generation a migration like this:

        rails g migration add_column_name_to_user name

    would not generating the correct table name.
fffc9fc
@kuldeepaggarwal kuldeepaggarwal added a commit to kuldeepaggarwal/rails that referenced this issue Mar 25, 2014
@kuldeepaggarwal kuldeepaggarwal Fix Generation of proper migration when
  ActiveRecord::Base.pluralize_table_names = false.

  Previously, generation a migration like this:

      rails g migration add_column_name_to_user name

  would not generating the correct table name.

Fixes #13426.
5a3817c
@senny senny closed this in #13440 Mar 25, 2014
@stevegraham stevegraham added a commit that referenced this issue Mar 26, 2014
@kuldeepaggarwal kuldeepaggarwal Fix Generation of proper migration when
  ActiveRecord::Base.pluralize_table_names = false.

  Previously, generation a migration like this:

      rails g migration add_column_name_to_user name

  would not generating the correct table name.

Fixes #13426.
bb44282
@eric-chahin eric-chahin added a commit to eric-chahin/rails that referenced this issue Apr 19, 2014
@kuldeepaggarwal kuldeepaggarwal Fix Generation of proper migration when
  ActiveRecord::Base.pluralize_table_names = false.

  Previously, generation a migration like this:

      rails g migration add_column_name_to_user name

  would not generating the correct table name.

Fixes #13426.
3d06255
@eric-chahin eric-chahin added a commit to eric-chahin/rails that referenced this issue Apr 19, 2014
@kuldeepaggarwal kuldeepaggarwal Fix Generation of proper migration when
  ActiveRecord::Base.pluralize_table_names = false.

  Previously, generation a migration like this:

      rails g migration add_column_name_to_user name

  would not generating the correct table name.

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