Commit Graph

253 Commits

Author SHA1 Message Date
Piotr Sarnacki
40b15f9f38 ActiveRecord::Base.joins should allow single nil argument [#6181 state:resolved] 2010-12-16 22:25:09 +01:00
Aaron Patterson
4cd3302279 make sure that join nodes are uniq 2010-12-16 01:49:30 +05:30
Aaron Patterson
18402b5d64 supporting arel AST nodes when building join statements 2010-12-16 01:49:29 +05:30
Aaron Patterson
b68407f7f0 bucketing based on join type 2010-12-16 01:49:29 +05:30
Aaron Patterson
c02fd2acc5 taking advantage of the JoinSource node in the SQL AST 2010-12-16 01:49:29 +05:30
Aaron Patterson
0042054ea8 remove lasgn since AST is mutated 2010-12-16 01:49:27 +05:30
Aaron Patterson
cea73f82ad just mutate the ast, fewer lasgns 2010-12-16 01:49:27 +05:30
Aaron Patterson
7d8fd57236 no more manager manipulation if there is no custom join ast 2010-12-10 11:38:43 -08:00
Aaron Patterson
ec72b6b3ec froms should never equal 0 2010-12-10 11:38:43 -08:00
Aaron Patterson
4dec00a9d8 manager will always be a manager 2010-12-10 11:38:43 -08:00
Aaron Patterson
82944b95a9 eliminate lasgns 2010-12-10 11:38:42 -08:00
Aaron Patterson
88bc49f2f7 dealing with an AST manager, not a relation, so fix the variable names 2010-12-10 11:38:42 -08:00
Aaron Patterson
17d72dd19f adding a fixme comment 2010-12-08 11:02:15 -08:00
Aaron Patterson
3499f882cc renaming variables, making the join_ast method private 2010-12-08 10:54:24 -08:00
Aaron Patterson
ddd6dee043 further reducing dependence on custom_joins 2010-12-08 10:35:26 -08:00
Aaron Patterson
2fd385d471 reducing use of custom joins 2010-12-08 10:29:52 -08:00
Aaron Patterson
1d96d44da3 passing the ast to a table when the relation is a table 2010-12-07 18:54:04 -08:00
Aaron Patterson
d98cb5153d JoinDependency is always created with an AST now 2010-12-07 17:05:15 -08:00
Aaron Patterson
2d9d6cd4c2 passing the ast to JoinDependency 2010-12-07 16:48:59 -08:00
Aaron Patterson
70ab450274 cleaning up custom_join_sql method 2010-12-07 14:01:37 -08:00
Aaron Patterson
d21f38aaa2 use the columns hash for primary key lookup 2010-12-03 15:33:59 -08:00
Aaron Patterson
542cb5c327 fix warnings, stop using global variables 2010-11-30 18:46:56 -08:00
Aaron Patterson
d51854a6be stop using splat args when we do not need them 2010-11-30 17:42:17 -08:00
Aaron Patterson
7408b6ec84 just grep the AST for OuterJoin nodes rather than converting the tree to SQL 2010-11-30 17:29:19 -08:00
Aaron Patterson
f1758525f9 reduce method calls on arel 2010-11-30 16:51:03 -08:00
Aaron Patterson
8998aea4b7 making relationship merge cheaper 2010-11-30 13:31:00 -08:00
Aaron Patterson
cdf6cf01cb use ARel rather than generate SQL strings 2010-11-24 13:55:55 -08:00
Aaron Patterson
d4b8d3bafa moving column_aliases to JoinDependency 2010-11-24 13:55:55 -08:00
Aaron Patterson
8e8fb8a429 just wrap as a sql literal 2010-11-23 14:42:55 -08:00
Neeraj Singh
d33dcba72d Do not send id for quoting twice if the primary key is string.
[#6022 state:resolved]
2010-11-23 14:33:00 -08:00
Aaron Patterson
dc320d5873 skip cloning if arguments are blank 2010-11-22 17:23:37 -08:00
Aaron Patterson
80d9b724c3 group can be done by left side only 2010-11-17 17:28:40 -08:00
Aaron Patterson
00693209ec collapsing same table / column WHERE clauses to be OR [#4598 state:resolved] 2010-11-17 17:10:50 -08:00
Aaron Patterson
56c5820458 use shorter form for sql literals 2010-11-17 16:15:52 -08:00
Aaron Patterson
7ebd36d1c4 refactor to reduce method calls 2010-11-16 11:43:11 -08:00
Alexandru Catighera
a5cdf0b9eb Fix ActiveRecord calculations when grouped by multiple fields 2010-11-16 10:38:47 -08:00
Aaron Patterson
ace84a003c support finding by a ruby class [#5979 state:resolved] 2010-11-15 20:25:43 -08:00
Aaron Patterson
dcdfc84f55 use quoted id of single AR::Base objects in predicates 2010-11-15 14:35:38 -08:00
Franck Verrot
983976ec54 Finder gives a little bit more info on the lookup column (primary key) 2010-11-13 06:32:08 +08:00
Aaron Patterson
06d518a323 stop recursively calling exists? 2010-11-05 15:36:36 -07:00
Santiago Pastorino
3146aa68fd Fixes queries using limits and punctuation in order, removes order("col1, col2") usage in favor of order(["col1", "col2"})
[#4597 state:committed]
2010-11-05 11:27:34 -07:00
Aaron Patterson
296467fcc4 only returning where values for the corresponding relation, also filtering where value hash based on table name [#5234 state:resolved] [#5184 state:resolved] 2010-10-30 13:25:49 -07:00
Aaron Patterson
7d5762d2c2 no need to merge where values if no new where values have been added 2010-10-30 12:28:49 -07:00
Aaron Patterson
9c7e2e4117 find_one uses prepared statement cache 2010-10-26 13:44:08 -07:00
Aaron Patterson
6ceffb8178 adding bind_values to relations 2010-10-26 13:44:07 -07:00
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