This project is archived and is in readonly mode.
Refactor build_arel
-
Emilio Tagua
- No changes were found…
-
José Valim
- Milestone cleared.
- Assigned user set to José Valim
-
Neeraj Singh
The last change in the attached patch is
- arel = @from_value.present? ? arel.from(@from_value) : arel.from(@klass.quoted_table_name) + arel = arel.from(@from_value) if @from_value.present?I have not analyzed the code fully but based on cursory look, it seems to me that a call to arel.from(@klass.quoted_table_name) is missing in else condition.
-
Emilio Tagua
No, there's no need to do that, that's why i didn't include it.
It's just creating another new relation that will end up creating the same.
If there's an edge case that i'm missing please let me know, all tests are passing with the patch, so if there's any issue that is introduced with this patch please let me know so i can change it and add proper tests.
-
Emilio Tagua
Oh, José both patches should be applied ;)
-
Repository
- State changed from new to resolved
(from [e061212e86ef0342fad1211fd980fc4b2195fe69]) Refactor build_arel: move joins out and simplify havings. [#4860 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/e061212e86ef0342fad1211fd980fc... -
José Valim
- State changed from resolved to open
Emilio, my git version was complaining that the second patch format was not valid. Could you please attach a new one? Links to commits in your fork is also ok. :)
-
Emilio Tagua
José,
I applied build_arel_2.diff in a fresh master, I don't know why you couldn't.
I attach a new patch with same changes, hope this time works for you.
Thanks!
-
Repository
- State changed from open to resolved
(from [7b7cedcb8d53110492e7d51405986f3e8e899fa4]) Don't waste time building relations if there are no values presents. [#4860 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/7b7cedcb8d53110492e7d51405986f...
