Commit Graph

70 Commits

Author SHA1 Message Date
Jeremy Kemper
6d29f9789e Fix evals missing context 2010-04-10 22:39:10 -07:00
Jeremy Kemper
86dda361e2 Avoid deprecated String#to_a by using Array.wrap(...) instead of Array(...) 2010-04-10 22:37:36 -07:00
Carl Lerche
6e18fa0375 Raise a StatementInvalid error when trying to build a condition with hash keys that do not correspond to columns. 2010-04-03 09:22:00 -07:00
Pratik Naik
cfa283201e Goodbye ActiveRecord::NamedScope::Scope 2010-04-02 18:57:46 +01:00
Pratik Naik
62fe16932c Make Relation#first and Relation#last behave like named scope's 2010-04-02 18:57:46 +01:00
Pratik Naik
b77dd218ce Add Relation extensions 2010-04-02 17:38:02 +01:00
Pratik Naik
bc7da9b77d Consistency when using Relation constants 2010-04-02 17:38:02 +01:00
Emilio Tagua
7006aa1a85 Arel now handles ranges with excluded end. 2010-03-29 12:30:13 -03:00
Emilio Tagua
53ddbfc460 Warn scoped order and limit are ignored. [#4123 state:resolved] 2010-03-29 11:30:06 -03:00
Xavier Noria
76f024ac8d adds missing requires for Object#blank? and Object#present? 2010-03-28 14:15:02 +02:00
Emilio Tagua
fc2e25734a Move methods from association to relation finder methods. 2010-03-25 15:47:06 -03:00
Emilio Tagua
90a4709601 Refactor relation merging to create just one relation and then assign values, instead of creating multiple relation objects. 2010-03-25 13:03:30 -03:00
Emilio Tagua
d289e15af9 From and lock should be defined to be consistent with other ivars. Limit and offset are always defined, no need to test that.
[#4253 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-03-22 11:48:39 -07:00
Aaron Patterson
587f468282 kill where / having method redefine warnings. [#4225 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
2010-03-18 13:30:59 -07:00
Emilio Tagua
e08c153a08 Arel now fallback to using Arel::Attribute if the table/column doesn't exists.
[#4142 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-03-10 13:49:11 -08:00
Aaron Patterson
aad432a9e9 removing spawn from SpawnMethods
Signed-off-by: wycats <wycats@gmail.com>
2010-03-10 13:29:00 -08:00
Pratik Naik
181c414baa Fix scope loading issue when the table doesn't exist 2010-03-10 11:28:04 +00:00
Aaron Patterson
45c36ea096 refactoring build_where
Signed-off-by: wycats <wycats@gmail.com>
2010-03-06 13:25:12 -08:00
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