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

Fix STI for fixtures from multi-files #18512

Merged
merged 1 commit into from
Feb 1, 2015

Conversation

vipulnsward
Copy link
Member

  • Add check for not deleting previously created fixtures, to overcome sti fixtures from multiple files
  • Added fixtures and fixtures test to verify the same

@vipulnsward
Copy link
Member Author

Tests related to random named files are failing due to unique constraints.
I am not sure what the behaviour for them should be, I think the fixtures are wrongly duplicated.

assert_equal pirates(:blackbeard), dead_parrots(:deadbird).killer
end


Copy link
Member

Choose a reason for hiding this comment

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

You added 2 spaces here, it should only be one 😄

- Add check for not deleting previously created fixtures, to overcome sti fixtures from multiple files
- Added fixtures and fixtures test to verify the same

- Fixed wrong fixtures duplicating data insertion in same table
@vipulnsward
Copy link
Member Author

Fixed spacing, also fixed random named fixture test, to not conflict data in a single table.

unless deleted_tables.include? table
conn.delete "DELETE FROM #{conn.quote_table_name(table)}", 'Fixture Delete'
end
deleted_tables << table
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this line be inside the unless block?

Copy link
Member Author

Choose a reason for hiding this comment

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

either of the way works fine

tenderlove added a commit that referenced this pull request Feb 1, 2015
@tenderlove tenderlove merged commit c792203 into rails:master Feb 1, 2015
arthurnn pushed a commit that referenced this pull request Feb 15, 2016
@arthurnn
Copy link
Member

backported c792203 to 4-2-stable. (6a25fd1)

@vipulnsward vipulnsward deleted the 18492-fixtures-with-sti branch February 22, 2016 14:35
arthurnn added a commit that referenced this pull request Feb 23, 2016
…h-sti"

This reverts commit 6a25fd1.

Reverting this as I thought it was a bug fix, but actually it is not.
This is more like a feature addition, as you can have STI for fixtures
right now if you have one fixture file for that table.
@arthurnn
Copy link
Member

reverted this. 8097019 , see the comment.

cc @jeremy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants