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 position when no serial positions #208

Merged
merged 2 commits into from Aug 21, 2016

Conversation

PoslinskiNet
Copy link
Contributor

Tasks:

  • Fix position in case of interrupted position data in the database. It should work in the event of positions of elements: [15, 25, 55].

@@ -256,9 +264,9 @@ def higher_items(limit=nil)
position_value = send(position_column)
acts_as_list_list.
where("#{quoted_table_name}.#{quoted_position_column} < ?", position_value).
where("#{quoted_table_name}.#{quoted_position_column} >= ?", position_value - limit).
# where("#{quoted_table_name}.#{quoted_position_column} >= ?", position_value - limit).
Copy link
Owner

Choose a reason for hiding this comment

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

Could you give a quick explanation why this isn't needed anymore? :)

@brendon
Copy link
Owner

brendon commented Jun 21, 2016

Thanks for this. It's a handy change. You need to add specific tests to test this scenario though. Also, rather than comment out code, just remove it and explain why.

@PoslinskiNet PoslinskiNet force-pushed the fix-not-serial-positions branch 2 times, most recently from 43125b9 to 43972eb Compare June 21, 2016 08:04
@PoslinskiNet
Copy link
Contributor Author

@brendon I've applied your feedback. Hopefully, I will find some time to add specs later this week.

@brendon
Copy link
Owner

brendon commented Jun 21, 2016

Thanks @PoslinskiNet, quite a few existing tests are failing now so you'll need to address why that is. I suspect it's because you've changed some pretty core methods. You may want to run the test suite locally to ensure things aren't broken before pushing your changes to the PR. Just run rake to run the tests once you've bundled.

@PoslinskiNet
Copy link
Contributor Author

@brendon I made some improvement, so most of the test are passing. However, 3 of them are still failing, so probably I will fix them later on.

@brendon
Copy link
Owner

brendon commented Jun 22, 2016

Thanks @PoslinskiNet, remember to also add those tests to test the functionality you're trying to add. :)

@jpalumickas
Copy link
Contributor

👍 would be nice to have this fix in next release

@brendon
Copy link
Owner

brendon commented Aug 16, 2016

Hi @jpalumickas, thanks for the spec to test your new feature. Unfortunately we can't accept this PR until the entire test suite is green. Can you work on this when you have time? This is a great feature to support, so I look forward to seeing it merged :)

@PoslinskiNet
Copy link
Contributor Author

@brendon @jpalumickas I've added some specs, but some other are still failing, and I don't have time to investigate it right now. If anyone sees the problem, I would be really grateful for the fix :).

@jpalumickas
Copy link
Contributor

@PoslinskiNet this is because you changed order in higher_items. You need to update 3 failing specs to use updated order.

@brendon brendon merged commit c674513 into brendon:master Aug 21, 2016
@PoslinskiNet PoslinskiNet deleted the fix-not-serial-positions branch January 27, 2017 20:26
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

3 participants