Commit Graph

52 Commits

Author SHA1 Message Date
Santiago Pastorino
ee541049fd avoid @lock_value not initialized warning 2010-02-22 14:08:07 -08:00
Pratik Naik
dc3cc6c608 Move batch finders to Relation 2010-02-12 22:31:03 +00:00
Pratik Naik
ec057ada07 Rely on arel to generate the correct sql when an empty array is supplied to IN predicate 2010-01-30 19:34:05 +00:00
Jeremy Kemper
fd0eb3d904 Clear up some ivar warnings 2010-01-27 19:33:03 -08:00
Pratik Naik
a68a3e9af6 Simplify finder method definitions 2010-01-21 22:29:21 +05:30
Pratik Naik
da142cd865 Supplying Arel::SqlLiteral is much faster 2010-01-21 17:52:09 +05:30
Pratik Naik
fa9f000246 Use quoted_table_name with arel.from() if no from values explicitly supplied. Arel seems to be spending a lot of time figuring out the FROM value otherwise. 2010-01-21 01:37:02 +05:30
Pratik Naik
24cc9e5b4f Relation#spawn is basically clone + reset 2010-01-21 00:41:15 +05:30
Pratik Naik
8bdcb6f072 Always use table.* in the finder query unless specified 2010-01-21 00:40:38 +05:30
Pratik Naik
459e9b29d4 Use @limit_value and @offset_value instead of calling arel 2010-01-20 22:20:56 +05:30
Pratik Naik
1fb78e3ed8 Base.merge_conditions is no longer needed 2010-01-20 20:37:17 +05:30
Pratik Naik
2493229674 Delegate exists? to Relation 2010-01-20 18:17:37 +05:30
Pratik Naik
5502780c69 Move array_of_strings? to Relation 2010-01-20 14:01:42 +05:30
Pratik Naik
52ec4311f5 Delegate all finders to Relation 2010-01-20 03:35:25 +05:30
Pratik Naik
74e3539cda Ignore order for simple calculations to make postgresql happy 2010-01-20 02:17:49 +05:30
Pratik Naik
9acf0af544 Remove Relation#where_clause 2010-01-19 23:11:54 +05:30
Pratik Naik
9465b84b54 Rename CalculationMethods to Calculations and get rid of the old Calculations module 2010-01-19 22:17:33 +05:30
Pratik Naik
8f63dcb648 Move the only remaining calculation method calculate() to Relation 2010-01-19 22:17:33 +05:30
Pratik Naik
ec63fdcff3 Get rid of construct_count_options_from_args 2010-01-19 20:43:03 +05:30
Pratik Naik
73b179eb68 Delegate count to Relation 2010-01-19 20:37:12 +05:30
Pratik Naik
4148c686ec Delegate :average, :minimum, :maximum, :sum to Relation 2010-01-19 15:50:47 +05:30
Pratik Naik
b9599502c9 Add Relation#construct_relation_for_association_calculations for calculations with includes 2010-01-19 15:22:09 +05:30
Pratik Naik
e6a68a5cc3 Add Relation#find_with_associations to load relation with eager loaded associations 2010-01-19 04:42:19 +05:30
Pratik Naik
2a2bc8e84a Handle invalid query IN() generated when a blank array is supplied in hash conditions 2010-01-18 18:56:55 +05:30
Pratik Naik
e1d507c7fb Dont check for class equaity when merging relations 2010-01-18 04:28:21 +05:30
Pratik Naik
88de6b2de2 Inherit named scope class Scope from Relation 2010-01-18 04:24:24 +05:30
Pratik Naik
dca3de3bc7 Make relations work as scopes 2010-01-17 23:22:11 +05:30
Pratik Naik
54a043895f Make merging of order values consistent 2010-01-17 14:19:41 +05:30
Pratik Naik
cd90dcb1bd Rename Model.active_relation to Model.unscoped 2010-01-17 03:00:56 +05:30
Pratik Naik
468cfcedd3 Improve the error message for class mismatch on Relation#merge 2010-01-17 02:08:42 +05:30
Pratik Naik
3968825f5f Make sure Model#active_relation always adds STI conditions if needed 2010-01-16 23:11:35 +05:30
Pratik Naik
61e831564a Add Relation#apply_finder_options for applying old finder options 2010-01-16 21:21:20 +05:30
Pratik Naik
bed9179aa1 Make scopes use relations under the hood 2010-01-16 00:02:46 +05:30
Pratik Naik
006519d2c9 Use Relation#except for reversing the order 2010-01-12 22:55:57 +05:30
Pratik Naik
a04486dc99 Delay building arel relation as long as possible for improved introspection 2010-01-12 22:25:55 +05:30
Pratik Naik
a68165833a Add Relation#create_with to explictily specify create scope 2010-01-04 03:50:16 +05:30
Pratik Naik
00f3f6dc31 Relation#merge and Relation#except should respect locks 2010-01-03 21:25:19 +05:30
Pratik Naik
3db876cb76 Relation#merge and Relation#except should respect havings 2010-01-03 20:50:04 +05:30
Pratik Naik
af5e1b4cc6 Add Relation#except 2010-01-03 19:43:29 +05:30
Pratik Naik
22bfd8b098 Rename a variable name for consistency 2010-01-03 19:20:40 +05:30
Pratik Naik
8edfa8f82f Move Relation#spawn and Relation#merge to a separate module 2010-01-03 18:57:57 +05:30
Pratik Naik
6f5f23aaa7 Add Relation#includes to be an equivalent of current finder option :include 2010-01-03 03:24:28 +05:30
Pratik Naik
7ff131f740 Make sure not to spalt string arguments 2010-01-02 13:43:50 +05:30
Pratik Naik
b35873a575 Rename Model.arel_table to Model.active_relation 2010-01-02 00:25:29 +05:30
Pratik Naik
8a32d37967 Handle Range with excluded end 2010-01-01 04:33:56 +05:30
Pratik Naik
c62e88a5ab Try using cached attribute before creating a new one 2010-01-01 04:17:56 +05:30
Pratik Naik
77c23b2104 Use PredicateBuilder for sql hash sanitization 2010-01-01 04:17:56 +05:30
Pratik Naik
141d3aff2f Fix the method name for recusion 2010-01-01 04:17:56 +05:30
Pratik Naik
3c23b71a09 Move predicate building to a stand alone PredicateBuilder class 2010-01-01 04:17:55 +05:30
Pratik Naik
fdc62cdcdb Use Arel::Attribute when building where conditions from hash 2010-01-01 02:22:03 +05:30