Commit Graph

4408 Commits

Author SHA1 Message Date
Aaron Patterson
50041e563a this reject can be replaced with compact 2010-09-21 15:25:09 -07:00
Aaron Patterson
fdd537e7f9 removing unused code 2010-09-21 15:25:09 -07:00
Aaron Patterson
d7877ffc30 remove some repeated code 2010-09-21 15:25:09 -07:00
Aaron Patterson
67a9ae6a66 break up giant method 2010-09-21 15:25:08 -07:00
Aaron Patterson
88b1d51f82 removing lolinject 2010-09-21 14:42:42 -07:00
Aaron Patterson
b7e4a97ab5 fixing tests. woo 2010-09-21 14:42:28 -07:00
Hemant Kumar
953d129bb2 remove join table rows before removing owner row for habtm associations, fixes#5674 2010-09-21 13:58:09 -07:00
Aaron Patterson
96bd936b64 providing arel with column information when possible [#5392 state:resolved] 2010-09-21 13:53:47 -07:00
Xavier Noria
f4abe66d35 un-nodocs AR::Batches 2010-09-21 20:44:45 +02:00
Emilio Tagua
d64a09b443 Remove helper methods that were moved to helper.rb
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-21 15:18:12 +02:00
Emilio Tagua
ae24ce52ae Move helper methods to helper.rb. Make test not depend on local TZ to pass or fail.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-21 15:07:43 +02:00
Stevie Graham
83ecd03e7d use instance_eval, reduce method calls.
execution time in seconds for `rake test_sqlite3`:

ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
  - before: 52.771426, 52.159505, 52.937056
  - after: 51.452584, 51.897017, 51.584431

rubinius 1.0.1 (1.8.7 release 2010-06-03 JI) [x86_64-apple-darwin10.4.0]
  - before: 284.334076
  - after: 285.753028

ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
  - before: 75.811548, 75.533153, 75.353122
  - after: 75.244243, 75.19226, 75.256925
2010-09-21 01:44:29 +08:00
Piotr Sarnacki
d475de7e25 Add helper for loading seed data for engine and application
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-20 10:41:05 +02:00
Thiago Pradi
3c9bf6e1dc Exception handling more readable
[#5601 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-19 12:18:51 -07:00
Xavier Noria
2b6c2e947b adds to the API guidelines the proper spelling of Arel 2010-09-19 00:05:05 +02:00
Tim Connor
37de59eacf Fix issue with remove_index and add unit test [#5645 state:resolved] 2010-09-18 20:49:31 +02:00
Tim Connor
55d0d57bfc Raise errors when index creation fails 2010-09-18 20:49:28 +02:00
Neeraj Singh
9401fa0b9c expanding the test to include both type of order declaration
while declaring default_scope

Also added test for unscoped using block style with four different
combinations

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-18 20:49:19 +02:00
Aaron Patterson
3480551e67 removing nonsensical tests, limit now actually adds a limit 2010-09-15 14:18:16 -07: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
Emilio Tagua
61bacc4ada Add more examples in performance script.
[#5610 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-09-10 13:15:13 -07:00
Jeremy Kemper
68a4b1eac9 Ruby 1.9 compat: convert Pathname to string 2010-09-10 12:16:56 -07:00
Jeremy Kemper
be9831ceb1 Switch back to mysql for easier comparison 2010-09-10 12:16:56 -07:00
Aaron Patterson
a11dd8ac87 specific number of spaces should not be enforced 2010-09-10 11:51:32 -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
kane
1c283765b6 added a test for relation which checks intersection between a relation and an array works in both directions
Signed-off-by: Mikel Lindsaar <raasdnil@gmail.com>
2010-09-10 21:13:57 +10:00
Raimonds Simanovskis
af2a011df2 fixed Subject model after_initialize callback for test_oracle_synonym test 2010-09-09 18:27:53 -07:00
Jeremy Kemper
e0e3adff03 Cheaper attribute reads and respond_to?. Add underscore-prefixed method aliased to the attribute name so it can be overridden but still called internally. 2010-09-09 14:39:43 -07:00
Jeremy Kemper
d79b1aa0ba Fewer object allocations 2010-09-09 14:37:58 -07:00
Jeremy Kemper
4b7b8d9e19 Cache unserialized attributes 2010-09-09 14:37:57 -07:00
Jeremy Kemper
cc81b04ae5 AR perf test: switch to mysql2, bundle faker and rbench 2010-09-09 14:34:47 -07: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
e3246ef5b5 Add tests for Relation#only. 2010-09-09 15:27:10 -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