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
Aaron Patterson
cb1f80591e
refactor to use faster empty?
2010-09-08 16:06:48 -07:00
Aaron Patterson
4ccf491ec2
drying up joins()
2010-09-08 15:34:03 -07:00
Aaron Patterson
86384b3c4b
reduce method calls, use reject + blank? instead of select + present?
2010-09-08 15:15:06 -07:00
Aaron Patterson
a5d894ce56
attributes should be constructed with table objects
2010-09-07 16:47:10 -07:00
Aaron Patterson
0c7a4daaa1
attributes should be associated with tables
2010-09-07 16:38:49 -07:00
Aaron Patterson
2e8a3d0f43
removing useless code, cleaning variable names
2010-09-07 11:28:01 -07:00
Aaron Patterson
604281221c
select should raise error when no block or no parameter is passed
2010-09-07 10:48:14 -07:00
Aaron Patterson
d00f1c18eb
select does not need a *args
2010-09-07 10:33:20 -07:00
Aaron Patterson
b541a963bd
cleaning up confusing logic
2010-09-06 18:56:16 -07:00
Santiago Pastorino
708ee9c5ac
Make scoped reorder override previous applied orders
...
[5528 state:committed]
2010-09-05 08:28:11 -03:00
Neeraj Singh
91fec0d24d
order should always be concatenated.
...
order that is declared first has highest priority in all cases.
Here are some examples.
Car.order('name desc').find(:first, :order => 'id').name
Car.named_scope_with_order.named_scope_with_another_order
Car.order('id DESC').scoping do
Car.find(:first, :order => 'id asc')
end
No special treatment to with_scope or scoping.
Also note that if default_scope declares an order then the order
declared in default_scope has the highest priority unless
with_exclusive_scope is used.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-05 08:13:42 -03:00
Emilio Tagua
32e296b6ff
Use new finders syntax in docs.
2010-09-01 12:16:08 -03:00
Pratik Naik
db6190a022
Make all the Relation finder methods consistent
2010-08-31 22:25:28 +01:00
Pratik Naik
dce0cfae8b
Merge remote branch 'miloops/rails_master_fixes'
2010-08-31 22:05:42 +01:00
Pratik Naik
7694b97ddf
Remove default values for Relation#limit/offset/from/create_with
2010-08-31 21:56:21 +01:00
Emilio Tagua
c11eec8482
Avoid calling build_where is no argument is given.
2010-08-31 15:47:59 -03:00
Pratik Naik
c07f0ae52e
Change relation merging to always append select, group and order values
2010-08-31 19:17:18 +01:00
Emilio Tagua
87e50f104a
Improved conditionals usage to prevent calling methods.
2010-08-31 15:06:02 -03:00
Emilio Tagua
2431af1b7f
Don't test conditional in iteration if it is not present just clone it.
2010-08-31 13:19:06 -03:00
Santiago Pastorino
68a949bae7
PERF: Avoid two method calls
2010-08-28 21:35:20 -03:00
Xavier Noria
fa8e17b5c2
Merge remote branch 'docrails/master'
2010-08-26 01:39:16 +02:00
Aaron Patterson
ffdda4ddfb
use blank? instead of present?, mark SQL literals as SQL literals
...
Conflicts:
activerecord/lib/active_record/relation/query_methods.rb
2010-08-25 05:17:49 -07:00
Aaron Patterson
b28cafe01a
no need to send on a public method
2010-08-25 05:17:49 -07:00
Aaron Patterson
ce7c2f72f4
refactor select { is_a? } to grep()
2010-08-25 05:17:49 -07:00
Neeraj Singh
4e40f00565
minor formatting fixes
2010-08-25 07:39:47 -04:00
Aaron Patterson
5931a1dbd3
sql literal strings should be marked as sql literal strings
2010-08-23 13:57:22 -07:00
Aaron Patterson
a70248c3d8
we should wrap strings as sql literals
2010-08-19 10:35:09 -07:00
Aaron Patterson
e4f424d577
refactoring to remove duplicate logic
2010-08-18 12:10:48 -07:00
Aaron Patterson
93f335b6fb
call to present? is not necessary
2010-08-18 11:51:59 -07:00
Santiago Pastorino
b451de0d6d
Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;)
2010-08-14 04:12:33 -03:00