Skip to content

Allow for singular table names when baking fixtures#85

Merged
markstory merged 2 commits intocakephp:masterfrom
dakota:singular-table-names
May 7, 2015
Merged

Allow for singular table names when baking fixtures#85
markstory merged 2 commits intocakephp:masterfrom
dakota:singular-table-names

Conversation

@dakota
Copy link
Copy Markdown
Member

@dakota dakota commented May 7, 2015

Encountered a use case where I am baking fixtures for all my tables. I have a few tables where the table name is singular. This PR adds in the ability to fallback to a singular table if the plural version does not exist.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should catch the specific exception

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am. Schema/Collection::describe() throws a Cake\Database\Exception, which is what I'm catching here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah ok

@adayth
Copy link
Copy Markdown

adayth commented May 7, 2015

I had the same issues with recommended i18n table.

@lorenzo
Copy link
Copy Markdown
Member

lorenzo commented May 7, 2015

Is it possible to add a test for this?

@dakota
Copy link
Copy Markdown
Member Author

dakota commented May 7, 2015

Test done :)

@markstory markstory added this to the 1.0.6 milestone May 7, 2015
@markstory
Copy link
Copy Markdown
Member

Any reason you didn't use the --table option?

@adayth
Copy link
Copy Markdown

adayth commented May 7, 2015

Maybe he tried to generate fixtures with bake fixtures all and found issue #86

@dakota
Copy link
Copy Markdown
Member Author

dakota commented May 7, 2015

@markstory, I was running bake fixtures all on order to refresh all fixture files at once.

@markstory
Copy link
Copy Markdown
Member

Ok, with all you can't really use the option, so trying one other table name makes sense.

markstory added a commit that referenced this pull request May 7, 2015
Allow for singular table names when baking fixtures
@markstory markstory merged commit 21e5df0 into cakephp:master May 7, 2015
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.

4 participants