Commit Graph

208 Commits

Author SHA1 Message Date
Aaron Patterson
dbc5d2694f reduce duplicate where removal to one loop 2010-10-20 08:41:25 -07:00
Aaron Patterson
8c511c0b3c swap out some n^2 for some n 2010-10-19 20:53:53 -07:00
Aaron Patterson
8d5829f149 dup rather than create so many arrays 2010-10-19 17:51:46 -07:00
Aaron Patterson
dc16163d06 use array math rather than looping through the array 2010-10-19 17:46:54 -07:00
Aaron Patterson
c56fea2be4 use shortened version to generate a sql literal 2010-10-19 17:44:33 -07:00
Aaron Patterson
08636527b5 avoid cloning if we do not need to clone 2010-10-19 17:44:07 -07:00
Aaron Patterson
78b6f64105 avoid creating a proc object when possible 2010-10-19 17:37:55 -07:00
Jon Leighton
19304a9758 Renaming and formatting changes in JoinDependency 2010-10-13 08:24:19 -07:00
Jon Leighton
7dcb633427 Refactor JoinDependency and friends so that a JoinAssociation can produce an arbitrary number of joins, which will be needed in order to support nested through associations. 2010-10-13 08:24:19 -07:00
Aaron Patterson
603406dc53 stop using deprecated arel API 2010-10-12 14:33:16 -07:00
Aaron Patterson
cecccf1156 we should always cast the value based on the column 2010-10-11 13:35:58 -07:00
Marcelo Giorgi
1c9022de21 Honor distinct option when used with count operation after group clause [#5721 state:resolved] 2010-10-11 09:39:34 -07:00
Santiago Pastorino
e0b76d6151 reorder removed in favor of except(:order).order 2010-10-11 11:54:46 -02:00
Aaron Patterson
83633b807a avoid creating objects when we can 2010-10-03 14:40:06 -07:00
Aaron Patterson
15419a5dc6 build_where should be private 2010-09-30 14:37:09 -07:00
Aaron Patterson
a8a62f87f6 [#5441 state:resolved] refactoring code to determine aggregate column 2010-09-30 10:17:38 -07:00
Aaron Patterson
dec3a759d1 removing more useless code! yay! 2010-09-28 17:32:38 -07:00
Aaron Patterson
8d9f7b5b99 SqlLiteral is a string, so we can dry up these conditionals 2010-09-28 17:31:31 -07:00
Aaron Patterson
b50b1ef9e8 shorten up or sql literal creation statements 2010-09-28 17:12:19 -07:00
Aaron Patterson
39d98e5c09 we only care about arrays and strings 2010-09-28 17:05:32 -07:00
Aaron Patterson
957e6fbe2a dry up calls to arel.join() 2010-09-28 17:03:36 -07:00
Aaron Patterson
ef2392f60b removing unused lasgns 2010-09-28 16:59:38 -07:00
Aaron Patterson
e6ca7e7197 refactoring to remove crazy logic 2010-09-28 16:14:39 -07:00
Neeraj Singh
3f16103daf performance improvement based on discussion at fbd1d306b9
Credit goes to all the participants in the discussion
2010-09-28 15:52:26 -07:00
Aaron Patterson
10041e2d45 removing a conditional that is not used 2010-09-28 15:39:24 -07:00
Aaron Patterson
d0fb0d770f fisting the postgresql tests 2010-09-28 15:32:12 -07:00
Aaron Patterson
9b561ab029 avoid calling to_sql when we can 2010-09-28 10:37:35 -07:00
Aaron Patterson
bf2223d0e0 removing an inject + merge in favor of Hash#[] 2010-09-28 10:30:42 -07:00
Aaron Patterson
f22b40a8f2 make sure we use the engine assigned to the table when quoting 2010-09-27 14:29:07 -07:00
Neeraj Singh
fbd1d306b9 Three performance improvements:
* for simple cases like User.last and User.order('name desc').last no need to perform Array#join operation.

* Instead of performing String#blank? do Array#empty?

* no need to create variable relation
2010-09-27 10:49:49 -07:00
Emilio Tagua
4513cc142c Goodbye inject, hello map.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:02 -03:00
Xavier Noria
f4abe66d35 un-nodocs AR::Batches 2010-09-21 20:44:45 +02:00
Xavier Noria
2b6c2e947b adds to the API guidelines the proper spelling of Arel 2010-09-19 00:05:05 +02:00
Aaron Patterson
55736ef125 @join_values is passed in, so we should use the parameter 2010-09-15 14:18:15 -07:00
Aaron Patterson
ac9c715947 passing the quoted id to arel if the object has a quoted id 2010-09-10 15:28:57 -07:00
Aaron Patterson
13aa1e11a0 converting an inject to a map + Hash[] 2010-09-10 15:28:57 -07:00
Aaron Patterson
a8b4bdb3d6 avoid method_missing and reduce method calls 2010-09-10 10:22:22 -07:00
Marcelo Giorgi
a513f8f8bb intersection between a relation and an array works in both directions
Signed-off-by: Mikel Lindsaar <raasdnil@gmail.com>
2010-09-10 21:14:07 +10:00
Emilio Tagua
53a90436cf Refactor finder conditions look up and assigment for apply_finder_conditions. 2010-09-09 13:45:49 -07:00
Emilio Tagua
90c114de67 Refactor Relation#only. No need to go through every option and test it. 2010-09-09 15:30:44 -03:00
Emilio Tagua
33412b6e16 No need to go through every option and test it, just don't add skipped ones. 2010-09-09 15:16:45 -03:00
Neeraj Singh
632120deb4 return is not needed here 2010-09-09 10:34:20 -07:00
Neeraj Singh
2f66b9a76c remove unnecessary call
if operation is count then column_name will never be blank
2010-09-09 10:33:52 -07:00
Aaron Patterson
be07d7b107 creating a new array is required. who knew? :-( 2010-09-09 10:33:22 -07:00
Aaron Patterson
a505c82d2f no need for Array.wrap, also avoid array creation 2010-09-09 09:44:01 -07:00
Neeraj Singh
d5c57f7c9f make apply_modules run faster 2010-09-09 09:35:40 -07:00
Aaron Patterson
03377c755f eliminate present? for fewer method calls 2010-09-08 16:56:13 -07:00
Aaron Patterson
b4fdfcf6ad returning arrays lets us avoid Array.wrap 2010-09-08 16:53:17 -07:00
Aaron Patterson
588db0fa8f removing unnecessary conditional test 2010-09-08 16:38:54 -07:00
Aaron Patterson
0db345a39d switch to blank? to avoid method calls 2010-09-08 16:33:16 -07:00