Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing has_many when ActiveRecord::Base.pluralize_table_names is false #560

Merged

Conversation

guilleiguaran
Copy link
Member

No description provided.

@jonleighton
Copy link
Member

Thanks for the pull request. I am going to add some comments in line. If you can make the changes (and squash into a single commit with git rebase -i) then I will get it merged ASAP.

@guilleiguaran
Copy link
Member Author

I make all changes except this one:

Rather than globally changing pluralize_table_names within the test, could you assign self.pluralize_table_names on the actual model (i.e. when defining the Aircraft class)?

Removing pluralize_table_names from test and putting self.pluralize_table_names in Aircraft class doesn't works as expected, looks like it is used globally and breaks a ton of tests that try to use singular table names (ex. Topic looks for 'topic' table)

@asanghi
Copy link
Contributor

asanghi commented May 15, 2011

I had the same problem.

Aircraft.pluralize_table_names = true does not limit the pluralization to the Aircraft model.

@lmanotas
Copy link

i'm getting same bug today, any chance to merge this soon?

jonleighton added a commit that referenced this pull request May 16, 2011
…false

Fixing has_many when ActiveRecord::Base.pluralize_table_names is false
@jonleighton jonleighton merged commit 2033ff8 into rails:master May 16, 2011
@jonleighton
Copy link
Member

Thanks for making the changes. If anybody fancies changing pluralize_table_names so that it can be applied just to individual classes then that would be cool too :)

@guilleiguaran
Copy link
Member Author

Thanks for making the changes. If anybody fancies changing pluralize_table_names so that it can be applied just to individual classes then that would be cool too :)

challange

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.

None yet

4 participants