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

where_object works only for update event #420

Closed
panSarin opened this issue Sep 10, 2014 · 6 comments
Closed

where_object works only for update event #420

panSarin opened this issue Sep 10, 2014 · 6 comments
Milestone

Comments

@panSarin
Copy link

Since it search only in "object" field, there is no way that it find 1st version (when event == create cause it always have object => nil). There is a reason of that , or it is TODO - i mean searching also in object_changes field?

@batter
Copy link
Collaborator

batter commented Sep 11, 2014

This is the intended behavior. The where_object method queries the object column (as the name implies). Not sure what you are asking exactly, you think it's valuable to have a where_object_changes method or something to that effect?

@panSarin
Copy link
Author

Yea , it would be nice idea, but probably the best solution would be to have 1 method that search in both fields just to check "changes" no matter if during create or update. If you tell me how you see it i will try to contribute.

@batter
Copy link
Collaborator

batter commented Sep 19, 2014

Querying 2 fields doubles the expense / time of the query. Depending on how many versions you are querying against this can be a lot, which is why I think it makes sense to break it into 2 separate methods.

@panSarin
Copy link
Author

Hmmm .. true. So maybe the best solution is to make 3 methods? 1 for update, 2 for create and 3td (slowest) for both ? Anyway , second method for create is TODO for sure, and the 3td one is "we can do it". So i will make pull request after my holidays . Greetings! ;]

@JacobEvelyn
Copy link
Contributor

@panSarin is the method for create you're describing querying both the versions table (to make sure there's only one entry—the create) and the ordinary object table?

@panSarin
Copy link
Author

tbh i dont know it yet ;]

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