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

Problem when updating an position of array of AR objects. #137

Closed
murugan-r opened this issue Nov 6, 2014 · 3 comments
Closed

Problem when updating an position of array of AR objects. #137

murugan-r opened this issue Nov 6, 2014 · 3 comments

Comments

@murugan-r
Copy link

I have an array of ActiveRecord Object and position. I need to update position of each AR object by iterating an array.

Problem when updating first AR object , it changes the position of all other positions and so. I end up doing via update_column but i have callbacks that needs to be trigger.

Is there any way to update position without reordering an position of other AR object at the same time needs to trigger callbacks.

Note:: I am using acts_as_list (0.4.0)

@murugan-r
Copy link
Author

@swanandp Update?

@swanandp
Copy link
Collaborator

I need to update position of each AR object by iterating an array.

Why is this a requirement?

@brendon
Copy link
Owner

brendon commented Apr 17, 2016

There isn't a way as far as I know. This seems to be the standard way to go about it: #112 (comment)

If you're just updating the position, then what callbacks do you need to run for that? :)

I'll close this for now, but feel free to comment further.

@brendon brendon closed this as completed Apr 17, 2016
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

No branches or pull requests

3 participants