Commit Graph

5139 Commits

Author SHA1 Message Date
Aaron Patterson 064c28d6c2 fixing dup regressions 2010-11-23 14:29:05 -08:00
Aaron Patterson 93d78b8318 fixing more dup tests 2010-11-23 14:29:05 -08:00
Aaron Patterson 6a8f1b8b40 renaming duplication test to dup test 2010-11-23 14:29:04 -08:00
Aaron Patterson c5858a6df3 adding a specific case for clone testing 2010-11-23 14:29:04 -08:00
Aaron Patterson 28f4df0908 testing duped attributes are independent 2010-11-23 14:29:04 -08:00
Aaron Patterson 4c1f76eaab initialize_clone can go away 2010-11-23 14:29:04 -08:00
Aaron Patterson 035d00b665 making sure changes to dup will not touch original 2010-11-23 14:29:04 -08:00
Aaron Patterson 5badf60d12 dup keeps changes 2010-11-23 14:29:04 -08:00
Aaron Patterson ca7b0a0d1a dup is working better 2010-11-23 14:29:03 -08:00
Xavier Noria 85d64316a4 Merge branch 'master' of git://github.com/lifo/docrails 2010-11-23 21:59:50 +01:00
Emilio Tagua 9f35799221 Refactor && simplify count_records. 2010-11-23 09:51:07 -08:00
Emilio Tagua e2bad8a2e7 No need to create a variables to use them once. 2010-11-24 01:37:02 +08:00
Emilio Tagua d29d793c90 Don't create local vars. 2010-11-24 01:37:01 +08:00
Emilio Tagua 6ffe0ef55b Avoid creating local var. 2010-11-24 01:37:01 +08:00
Emilio Tagua 63c9185b62 Remove explicit return and avoid creating local var. 2010-11-24 01:37:01 +08:00
Emilio Tagua 1b531b7ee2 Remove explicit return. 2010-11-24 01:37:00 +08:00
Emilio Tagua b8df3a9197 Use params default. 2010-11-24 01:37:00 +08:00
Emilio Tagua 861cdc4c59 Remove unneeded local var. 2010-11-24 01:36:59 +08:00
Emilio Tagua 9c161599ac Remove uneeded local var definition. 2010-11-24 01:36:59 +08:00
Emilio Tagua a9e963d51d Remove confusing parenthesis. 2010-11-24 01:36:59 +08:00
Emilio Tagua 14055ea282 No need to define a local var here. 2010-11-24 01:36:59 +08:00
Ray Baxter de829f871b fix typo 2010-11-22 22:11:56 -08:00
Aaron Patterson dc320d5873 skip cloning if arguments are blank 2010-11-22 17:23:37 -08:00
Aaron Patterson 4ece7e06fd removing space error 2010-11-22 17:06:55 -08:00
Aaron Patterson 4d31ee1e0e removing unused variables 2010-11-22 16:14:37 -08:00
Alex Rothenberg 66c09372f3 Removed ids_in_list_limit in favor of in_clause_length defined in database_limits.rb 2010-11-23 06:43:18 +08:00
Neeraj Singh 5debc65c35 Merge branch 'master' of github.com:lifo/docrails 2010-11-22 17:32:27 -05:00
Neeraj Singh 1c68e55ae5 Revert "unscoped takes care of named_scopes too"
This reverts commit 126fbd7ed8.
2010-11-22 17:32:15 -05:00
Matthew Rudy Jacobs 16d7ba0698 Cleaner way to extract the Postgres version 2010-11-21 20:45:01 +08:00
Neeraj Singh c8ab3992f8 unscoped takes care of named_scopes too 2010-11-21 03:29:43 +01:00
Josh Kalderimis 8796f9a31a removed an AR method which wasn't used internally, had no tests, and had no docs
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-20 19:40:32 +01:00
Josh Kalderimis d7db6a8873 class inheritable attributes is used no more! all internal use of class inheritable has been changed to class_attribute. class inheritable attributes has been deprecated.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-20 19:40:29 +01:00
Matthew Rudy Jacobs d9ac62c914 Fix Bug: disable_referential_integrity doesn't work for postgres 9.0.1 2010-11-21 00:18:33 +08:00
Aaron Patterson 938243feb9 do not require ruby-debug automatically. please require it if you have declared it as a dependency 2010-11-19 16:26:09 -08:00
Aaron Patterson 6bd93f672a wtf vim 2010-11-19 11:48:23 -08:00
Aaron Patterson 598fc85f9e fisting typeo, thanks @vinibaggio 2010-11-19 11:42:58 -08:00
Aaron Patterson a4d9b1d329 adding documentation for reversible migrations 2010-11-19 11:34:42 -08:00
Aaron Patterson db32b545da adding Migration#change to the CHANGELOG 2010-11-19 11:20:02 -08:00
Aaron Patterson 87124457e5 fisting my spelling errors 2010-11-19 10:55:57 -08:00
Aaron Patterson 0cc6c46fe9 testing a non-invertible migration case 2010-11-19 10:50:24 -08:00
Aaron Patterson 47017bd169 invertable migrations are working 2010-11-19 10:31:03 -08:00
Aaron Patterson 6519df4157 command recorder will record commands sent to a delegate object 2010-11-19 10:24:16 -08:00
Aaron Patterson 6dbbfae563 adding invertable migration test 2010-11-19 10:24:16 -08:00
Aaron Patterson 0d7410faab updating documentation 2010-11-19 10:24:16 -08:00
Aaron Patterson 96b50a0392 IrreversibleMigration is raised if we cannot invert the command 2010-11-19 10:24:15 -08:00
Aaron Patterson b29a24bb6f commands are reversed 2010-11-19 10:24:15 -08:00
Aaron Patterson 5d93900dc6 add and remove timestamps can be inverted 2010-11-19 10:24:15 -08:00
Aaron Patterson 24b637a80f inverting add_index 2010-11-19 10:24:15 -08:00
Aaron Patterson 843e319f78 partial implementation of the command recorder 2010-11-19 10:24:15 -08:00
Aaron Patterson 24174d1b3a this return value is not used, so stop returning it 2010-11-19 10:23:13 -08:00
Aaron Patterson 9280fbf795 instantiate the delegate object after initialize is defined so that our initialize method actually gets called 2010-11-19 10:14:13 -08:00
Aaron Patterson 07a74f196d connection is set from the connection pool during migrations 2010-11-18 15:53:59 -08:00
Aaron Patterson e107dcca6b testing multiple ORd queries 2010-11-18 13:39:57 -08:00
Aaron Patterson 26923756fb removing space errors 2010-11-18 10:01:29 -08:00
Alex Rothenberg c5a284f8eb Adapters can specify maximum number of ids they support in a list of expressions
(default is nil meaning unlimited but Oracle imposes a limit of 1000)
Limit is used to make multiple queries when preloading associated has_many or habtm records
2010-11-18 09:59:52 -08:00
Neeraj Singh 126fbd7ed8 unscoped takes care of named_scopes too 2010-11-17 21:46:55 -05:00
Aaron Patterson 80d9b724c3 group can be done by left side only 2010-11-17 17:28:40 -08:00
Santiago Pastorino c6bfd6802a When use where more than once on the same column, relation doesn't do an 'or' or 'in' with the values 2010-11-17 17:15:25 -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
Jon Leighton fe42c00ac3 Fix bug with 0bb85ed9ff which missed out a fixtures declaration in cascaded_eager_loading_test.rb 2010-11-17 15:52:18 -08:00
Neeraj Singh 9c1993bf6b replace and with && as per rails coding convention 2010-11-18 07:49:45 +08:00
Neeraj Singh f978c4b2e4 remove the rescue block by returning a not asking Base for lookup_ancestors. It was also marked for later optimization. 2010-11-17 15:44:04 -08:00
Aaron Patterson 43e2e10f4f adding an initialize with name and version defaults 2010-11-17 15:30:09 -08:00
Aaron Patterson 4d35f8b661 updating generators 2010-11-17 14:57:54 -08:00
Aaron Patterson c1a63c8dba fixing more documentation 2010-11-17 14:57:54 -08:00
Aaron Patterson d1fcba8118 fixing documentation, removing unused AS files 2010-11-17 14:57:54 -08:00
Aaron Patterson 7906e08bba fixing indentation since these methods are not class methods 2010-11-17 14:57:54 -08:00
Aaron Patterson 606e41a4dd these methods are no longer needed 2010-11-17 14:57:54 -08:00
Aaron Patterson 17c7723451 updating CHANGELOG 2010-11-17 14:26:35 -08:00
Aaron Patterson b0a6f58068 do not need these accessors 2010-11-17 14:26:35 -08:00
Aaron Patterson 68b66ef308 testing instance based migrations 2010-11-17 14:26:35 -08:00
Aaron Patterson 974ff0dd43 singleton method added is no longer needed 2010-11-17 14:26:35 -08:00
Aaron Patterson 0bea9fd6be schema migrations work as instances 2010-11-17 14:26:34 -08:00
Aaron Patterson 8b2f801ed8 converted migrations to support instance methods 2010-11-17 14:26:34 -08:00
Aaron Patterson 77440ec51a fixing assertions so error messages will be more helpful 2010-11-17 13:02:03 -08:00
Carl Lerche ccd2f3ede5 Update the version.rb files to include a PRE part 2010-11-16 17:19:46 -08:00
Aaron Patterson 2738ec891b removing many unused variables 2010-11-16 17:06:50 -08:00
Aaron Patterson 08c64bbd39 super automatically passes on the implicit block 2010-11-16 14:28:19 -08:00
Aaron Patterson 05320e3788 use unless instead of if ! 2010-11-16 14:28:19 -08:00
Aaron Patterson 5f608fc7c4 removing space errors 2010-11-16 14:28:19 -08:00
Aaron Patterson c801f233df reloading an association will properly set attributes of instantiated objects. Thanks Brian Palmer [#5802 state:resolved] 2010-11-16 14:28:19 -08:00
Aaron Patterson 59ba800698 refactoring uniq method 2010-11-16 13:34:18 -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
Piotr Sarnacki 437ceab139 Create directory before copying migrations if it does not exist 2010-11-16 17:00:01 +01:00
Xavier Noria a820d0afdd revises RDoc of AR::Base#== 2010-11-16 15:58:37 +01:00
Santiago Pastorino 4718d097ff Models should be equals even after destroyed
[#5978 state:committed]
2010-11-16 12:40:40 -02:00
Aaron Patterson ace84a003c support finding by a ruby class [#5979 state:resolved] 2010-11-15 20:25:43 -08:00
Aaron Patterson 7bf9cbb766 adding more test coverage around finding with active record objects 2010-11-15 15:30:58 -08:00
Aaron Patterson dcdfc84f55 use quoted id of single AR::Base objects in predicates 2010-11-15 14:35:38 -08:00
Neeraj Singh 7c5c1a07c0 if association is already loaded and if a find operation is performed on the already loaded association list with an empty hash then do not perform another sql
[#5972 state:resolved]
2010-11-15 10:12:23 -08:00
Aaron Patterson 022519a032 fisting a bunch of unused variable warnings 2010-11-15 10:12:09 -08:00
Santiago Pastorino bc556a21e2 Remove unused var 2010-11-14 15:34:07 -02:00
Jason Cheow 93c9f4a942 Fix bug where size of through association is not correct after adding a has_many association (occurs only before main object has been reloaded).
[#5968 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-14 15:32:52 -02: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
Santiago Pastorino b734e192a7 present? is better here 2010-11-11 19:00:33 -02:00
José Valim f912a359aa Merge remote branch 'drogus/plugin_new'
Conflicts:
	railties/test/generators/app_generator_test.rb
2010-11-11 19:39:21 +01:00
Franck Verrot de2933e1a0 STI type is now updated when calling AR::Base.becomes on subclasses [#5953 state:resolved] 2010-11-12 02:17:34 +08:00
Santiago Pastorino 296e5c38f1 Use ! instead of not 2010-11-11 15:24:49 -02:00
Santiago Pastorino 894fd28859 Fixed bug in active_record/nested_attributes where an empty string id caused an ActiveRecord::RecordNotFound error. Found by [Ben Tillman]
[#5638 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-11 15:23:40 -02:00
Santiago Pastorino ceef719924 Bump Arel up to 2.0.2 2010-11-11 15:05:12 -02:00
José Valim 9c9f416d39 Allow AR Session Store to be renewed 2010-11-11 14:17:14 +01:00
Xavier Noria 41366cdec6 syncs CHANGELOGs for 3.0.2 in 3-0-stable with the ones in master 2010-11-09 20:56:41 +01:00
Santiago Pastorino 88a559d414 Double negation of an already boolean value produces the same result 2010-11-09 16:53:03 -02:00
Santiago Pastorino 75dfd95618 Don't check if persisted is defined just initialize it properly 2010-11-09 16:00:02 -02:00
Santiago Pastorino 994a1c2a47 Execute less operations 2010-11-09 14:03:09 -02:00
David Chelimsky 1f06652a57 use persisted? instead of new_record? wherever possible
- persisted? is the API defined in ActiveModel
- makes it easier for extension libraries to conform to ActiveModel APIs
  without concern for whether the extended object is specifically
  ActiveRecord

[#5927 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-09 13:54:04 -02:00
Michael Koziarski 3d6eea0221 Update the validates_uniqueness_of documentation to tell you to use a unique index.
The other options mentioned were not good ideas and disclaimed as such in the documentation.
2010-11-08 10:16:40 +13:00
Raimonds Simanovskis 6709078eb1 use column names as order by complex function parameters, fix for postgresql adapter to correctly remove ASC/DESC
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-07 09:55:17 -02:00
Aaron Patterson 1acc086278 reduce duplication in assiciations #construct() 2010-11-06 18:20:08 -07:00
Aaron Patterson c11102d4f8 make sure we keep parent records in order 2010-11-06 14:32:41 -07:00
Aaron Patterson 39a8056791 only call to_s on the association variable once 2010-11-05 17:08:56 -07:00
Aaron Patterson c43d909ee2 simplify instantiate in the join parts object 2010-11-05 16:56:50 -07:00
Aaron Patterson d89d702361 index is not used, so removing it 2010-11-05 16:56:50 -07:00
Aaron Patterson a79e1de90a reduce method calls to the join base object 2010-11-05 16:56:50 -07:00
Aaron Patterson 06d518a323 stop recursively calling exists? 2010-11-05 15:36:36 -07:00
Santiago Pastorino 00261a187e Avoid warning: shadowing outer local variable 2010-11-05 16:34:23 -02: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 d5e45931a0 renaming exec in the mysql adapter 2010-11-05 10:21:14 -07:00
Aaron Patterson 0f45f23669 renaming exec in the PG adapter 2010-11-05 10:15:33 -07:00
Aaron Patterson 9a08517c8d converted exec to exec_query for sqlite 2010-11-05 10:08:38 -07:00
sblackstone 710dcf826a Association Proxy should not undefine the default respond_to_missing 2010-11-04 15:02:27 -07:00
Aaron Patterson fa4686243c ignoring certain SQL when using Oracle 2010-11-03 17:34:49 -07:00
Aaron Patterson 6367e95867 select goes through exec(), so no method chaining for query counts 2010-11-03 17:34:49 -07:00
Aaron Patterson 5c6978608d use bind params in select with query monkeypatch 2010-11-03 17:34:49 -07:00
Piotr Sarnacki cfbe595831 Use application's generators defaults as engine defaults to not force users to manually set it 2010-11-02 17:14:52 +01:00
Pratik Naik 18b6aa6538 Make should_record_timestamps? serialization aware rather than object#changed? 2010-11-02 01:45:30 +00:00
Pratik Naik e911ed1f0f Ensure save always updates timestamps when serialized attributes are present 2010-11-02 01:42:49 +00:00
Pratik Naik c5c2e4fefd Add timestamps to Topic 2010-11-02 01:24:31 +00: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 cbca12f908 adding tests for #5234 and #5184. Tests were from Akira Matsuda. Thanks Akira! 2010-10-30 13:20:54 -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
Denis Odorcic cc9742920c Convert :primary_key in association to a string before comparing to column names, so that for example :primary_key => :another_pk works as well [#5605 state:resolved] 2010-10-30 11:24:36 -07:00
Aaron Patterson 67a3a70295 refactoring find_join_association 2010-10-30 08:45:40 -07:00
Ernie Miller 0bb85ed9ff Fix issues when including the same association multiple times and mixing joins/includes together. 2010-10-30 06:48:44 -07:00
Jon Leighton b82fab25f9 Refactoring: replace the mix of variables like @finder_sql, @counter_sql, etc with just a single scope hash (created on initialization of the proxy). This is now used consistently across all associations. Therefore, all you have to do to ensure finding/counting etc is done correctly is implement the scope correctly. 2010-10-30 06:30:00 -07:00
Aaron Patterson 2a47e7ef10 only do string substitution on column names once, remove intermediate data structures 2010-10-30 06:16:54 -07:00
Aaron Patterson 2e07260f36 columns are always strings 2010-10-30 06:12:50 -07:00
Aaron Patterson 6cf44a1bd6 no need to to_i, sqlite does that for us 2010-10-30 06:11:06 -07:00
Aaron Patterson 6a3d6b7f13 select_all() should always return an array, so no need to test 2010-10-27 14:39:24 -07:00
Aaron Patterson f6ddb3553a fisting test name 2010-10-27 14:33:02 -07:00
Aaron Patterson 9ce0211806 speeding up query cache 2010-10-27 14:23:01 -07:00
Aaron Patterson 7104122cc3 making query cache work with prepared statements 2010-10-27 14:05:40 -07:00
Aaron Patterson e73b0b84d9 renaming bind_values to binds where it makes sense 2010-10-26 13:44:11 -07:00
Aaron Patterson 104d0b263e adding backwards compatibility for non-prepare statement handling drivers 2010-10-26 13:44:11 -07:00
Aaron Patterson fca229e205 caching column values 2010-10-26 13:44:11 -07:00
Aaron Patterson 02128d628c setting the authorized session clears the statement cache 2010-10-26 13:44:11 -07:00
Aaron Patterson 9d9aed433b add a session authorization setter to the pg connection 2010-10-26 13:44:11 -07:00
Aaron Patterson 1741bbe2d5 avoiding statement cache if there are no bind values 2010-10-26 13:44:10 -07:00
Aaron Patterson 28a18b5988 folding async_exec to exec 2010-10-26 13:44:10 -07:00
Aaron Patterson 03e4ea5290 clear cache before resetting the connection 2010-10-26 13:44:10 -07:00
Aaron Patterson 1b4e0b6542 prepare the statement before we cache the key 2010-10-26 13:44:10 -07:00
Aaron Patterson 43bbb25ddd bind substitution is working properly 2010-10-26 13:44:10 -07:00
Aaron Patterson 9d46e0d012 bind parameters are now typecast 2010-10-26 13:44:10 -07:00
Aaron Patterson e2813479f9 basic bind parameters are working 2010-10-26 13:44:09 -07:00
Aaron Patterson ffb999125a initial exec() method is working in pg adapter 2010-10-26 13:44:09 -07:00
Aaron Patterson eb83eb6c98 monkey patching with enumerable so we can call each 2010-10-26 13:44:09 -07:00
Aaron Patterson fe2ee4fafd monkey patching Mysql::Stmt, calling free on the metadata 2010-10-26 13:44:09 -07:00
Aaron Patterson ee959a9ca1 free the result after slurping 2010-10-26 13:44:09 -07:00
Aaron Patterson efc10a8a64 eliminating some calls to execute() 2010-10-26 13:44:09 -07:00
Aaron Patterson 050d7d3e49 statements are cached, cache is cleared on reconnect 2010-10-26 13:44:09 -07:00
Aaron Patterson d4b0bcb88e all mysql tests are passing 2010-10-26 13:44:09 -07:00
Aaron Patterson d6b16bbaf7 one more mysql test left! 2010-10-26 13:44:09 -07:00
Aaron Patterson 77b1193ac1 mysql tests are mostly passing 2010-10-26 13:44:08 -07:00
Aaron Patterson 9c7e2e4117 find_one uses prepared statement cache 2010-10-26 13:44:08 -07:00
Aaron Patterson 5abebfb569 clearing statements on disconnect and reset 2010-10-26 13:44:08 -07:00
Aaron Patterson 54ff59f3ba refactoring tests 2010-10-26 13:44:08 -07:00
Aaron Patterson d7207cf504 type casting bound value based on column associated with value 2010-10-26 13:44:08 -07:00
Aaron Patterson 76d0805786 stop calling execute directly on the database connection 2010-10-26 13:44:08 -07:00
Aaron Patterson 77d548a6d3 removing another execute 2010-10-26 13:44:08 -07:00
Aaron Patterson 7023d73f26 removing more execute calls 2010-10-26 13:44:08 -07:00
Aaron Patterson e60fecd829 removing more calls to execute 2010-10-26 13:44:08 -07:00
Aaron Patterson 853d39e854 removing some uses of execute 2010-10-26 13:44:07 -07:00
Aaron Patterson cc468d3ec8 exec returns an AR::Result 2010-10-26 13:44:07 -07:00
Aaron Patterson 6ceffb8178 adding bind_values to relations 2010-10-26 13:44:07 -07:00
Aaron Patterson 497218d5db adding bind value substitution 2010-10-26 13:44:07 -07:00
Aaron Patterson ef0cf143a9 adding the abstract method 2010-10-26 13:44:07 -07:00
Aaron Patterson c376fd488c Revert "removing unused variable"
This reverts commit 3e4ede81d6.
2010-10-26 13:43:06 -07:00
Aaron Patterson f61f758761 reducing the number of parameters to select() 2010-10-26 13:43:06 -07:00
Aaron Patterson 5685a5c41c refactor to remove `through_records` 2010-10-23 20:29:46 -07:00
Aaron Patterson 6c998a79c8 removing dead code 2010-10-23 20:29:46 -07:00
Aaron Patterson 3e4ede81d6 removing unused variable 2010-10-23 20:29:46 -07:00
Aaron Patterson ee71a3fbfc removing call to deprecated API, this test is outside AR responsibilities 2010-10-22 13:33:59 -07:00
Aaron Patterson 1ce76db918 if it responds to :usec, it should also "act like" a time 2010-10-22 13:31:44 -07:00
Aaron Patterson 40491b4654 removing space errors 2010-10-22 10:35:08 -07:00
Xavier Noria a031fc57c8 made a pass in AR's schema.rb to keep (most) create statements in lexicographic order, and fixed an FK 2010-10-22 16:55:02 +02:00
Xavier Noria 5b86c3e5bb has_one maintains the association with separate after_create/after_update
This way parent models can get their own after_create and
after_update callbacks fired after has_one has done its job.
2010-10-22 10:28:53 +02:00
Aaron Patterson 410114e85a adding a test to ensure offsets with no limits will work [#5316 state:resolved] 2010-10-20 17:17:22 -07:00
Aaron Patterson 828bb94d5a use grep instead of select + is_a? 2010-10-20 16:41:50 -07:00
Aaron Patterson 4be0fc124a use a map and flatten to avoid << calls on array 2010-10-20 16:20:49 -07:00
Aaron Patterson 784177aeee only call `column_methods_hash` once, use array math for faster test of existence 2010-10-20 16:17:15 -07:00
Aaron Patterson 7f444a3db6 roll up weird method to meta programmed method 2010-10-20 15:51:44 -07:00
Aaron Patterson fb835fc1e2 use zip + Hash.[] rather than looping with an index 2010-10-20 15:46:04 -07:00
Aaron Patterson 954bd126ec extract options is not necessary 2010-10-20 15:07:17 -07:00
Aaron Patterson 03d4b86e78 removing unused variable 2010-10-20 14:58:16 -07:00
Aaron Patterson 96e8e97e78 removing unused variables 2010-10-20 09:38:15 -07:00
Jan 21beedf1ff default scope merge where clauses [#5488 state:resolved] 2010-10-20 09:00:36 -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
Aaron Patterson 08636527b5 avoid cloning if we do not need to clone 2010-10-19 17:44:07 -07:00
Aaron Patterson 78b6f64105 avoid creating a proc object when possible 2010-10-19 17:37:55 -07:00
Aaron Patterson d2898d4ef8 scopes can take an object that responds to `call` 2010-10-19 17:29:25 -07:00
Aaron Patterson 56be4c897a avoid creating the proc object if possible 2010-10-19 17:29:25 -07:00
Aaron Patterson e68f339aae default scope can accept any object that responds to #call 2010-10-19 15:07:44 -07:00
Tim Morgan b1b26af9a2 Allow default_scope to accept a Proc. 2010-10-19 14:43:31 -07:00
Anil Wadghule d7799fadf9 Fix SQLite adapter name [#5842 state:resolved] 2010-10-19 10:44:59 -07:00
Aaron Patterson 1856e975c3 "instance_methods" includes public and protected 2010-10-19 08:30:45 -07:00
Michał Łomnicki 4120e95dce Use ALTER INDEX syntax to rename an index 2010-10-19 08:40:28 +08:00
Santiago Pastorino 460c4efd71 Merge CHANGELOGs from 3-0-stable 2010-10-18 12:24:41 -02:00
Santiago Pastorino 67df21f895 No need for parenthesis here 2010-10-17 12:34:51 -02:00
Neeraj Singh f527f9097b no need to check for nil
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-10-17 12:26:47 -02:00
Neeraj Singh ea14396c45 replace if ! with unless
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-10-17 12:26:32 -02:00
Aaron Patterson dc76e3c38f should sort these ids before asserting they are equal! 2010-10-15 15:47:09 -07:00
Aaron Patterson 552636c652 testing that symbols work as sql literals 2010-10-15 15:46:13 -07:00
Xavier Noria 21ff8849bb in regexps, the dot in a character class is not a metacharacter 2010-10-15 16:31:00 +02:00
Carl Lerche 69789c3b29 #transaction on the instance level should take options as well 2010-10-14 21:27:40 -07:00
Michael Koziarski 9ebe582830 Revert 0c0b0aa0f2 which introduced a security vulnerability.
This addresses  CVE-2010-3933

Conflicts:

	activerecord/lib/active_record/nested_attributes.rb
2010-10-15 10:27:33 +13:00
Xavier Noria 13f7f89bda Merge branch 'master' of git://github.com/lifo/docrails 2010-10-14 23:15:23 +02:00
Piotr Sarnacki f07cbec865 Do not treat information about skipped migrations as WARNINGs but as a NOTEs, also puts to stdin 2010-10-14 07:46:12 +02:00
Aaron Patterson 676a00163d clear any stale connections before messing with threaded tests 2010-10-13 16:58:03 -07:00
Carl Lerche 91ba75806f Update the ActiveRecord tests to not set unused options
This makes a test fail, but it is revealing a bug in Arel master.
2010-10-13 12:32:52 -07:00
Rafael Mendonça França aec5ef243a Remove doc for debugging callbacks. Methods don't exist in Rails master 2010-10-13 15:59:57 -03:00
Carl Lerche 0b6af35ef0 Update the PostgreSQL adapter documentation 2010-10-13 11:49:32 -07:00
Carl Lerche 941844cbe5 rb_thread_select should always be used in DB drivers when available. 2010-10-13 11:40:47 -07:00
Jon Leighton 1ddbb216ea Delete unused methods in JoinAssociation 2010-10-13 08:24:19 -07:00
Jon Leighton 19304a9758 Renaming and formatting changes in JoinDependency 2010-10-13 08:24:19 -07:00
Jon Leighton 7dcb633427 Refactor JoinDependency and friends so that a JoinAssociation can produce an arbitrary number of joins, which will be needed in order to support nested through associations. 2010-10-13 08:24:19 -07:00
Jon Leighton 076b75bf98 Add some tests for functionality in JoinAssociation which already exists but was previously untested 2010-10-13 08:24:19 -07:00
Aaron Patterson 603406dc53 stop using deprecated arel API 2010-10-12 14:33:16 -07:00
Aaron Patterson 25a2909355 dry up column type testing 2010-10-12 13:13:19 -07:00
Aaron Patterson 4b2e16ed24 all columns respond to string_to_binary, so no need to check respond_to? 2010-10-12 13:10:52 -07:00
Aaron Patterson 5b5ae01f29 drying up true and false cases 2010-10-12 11:59:20 -07:00
Aaron Patterson 01893f43f6 reducing comparisons in when statements 2010-10-12 11:55:52 -07:00
Aaron Patterson 9852a72417 removing intermediate variables 2010-10-12 11:48:41 -07:00
Aaron Patterson c882154cd1 reduce the number of times we test for the column variable 2010-10-12 11:45:59 -07:00
Aaron Patterson 0ca9c836c0 test quoting a string with an unknown column type 2010-10-12 11:43:50 -07:00
Aaron Patterson 31b132aa9b refactoring date / time / datetime when statement 2010-10-12 11:41:23 -07:00
Aaron Patterson ef11ce2af8 fixing case / when indentation 2010-10-12 11:38:40 -07:00
Aaron Patterson 98cb754cd7 test quoting multibyte chars object 2010-10-12 11:38:07 -07:00
Aaron Patterson 2681dd81b4 test quoting strings with binary columns 2010-10-12 11:34:21 -07:00
Aaron Patterson 4804cb485c test quoting a string with a float column 2010-10-12 11:30:34 -07:00
Aaron Patterson 50ad7f6561 testing quoting a string for an int column 2010-10-12 11:29:28 -07:00
Aaron Patterson 07b0b5b330 testing crazy object quoting 2010-10-12 11:25:20 -07:00
Aaron Patterson 1ba3489b75 test that dates / times / datetimes call quoted_date 2010-10-12 11:21:35 -07:00
Aaron Patterson 8b33f66891 test quoting of bigdecimals 2010-10-12 11:08:10 -07:00
Aaron Patterson ba0a6772bb testing floats, fixnum, and bignums 2010-10-11 17:57:47 -07:00
Aaron Patterson 8e8a5f33f4 test quoting nils, true, false, id 2010-10-11 17:52:10 -07:00
Aaron Patterson 2610bcbd94 getting quoted_time under more specific tests 2010-10-11 17:52:10 -07:00
Aaron Patterson b9d4341bd0 starting to get the quote module under test 2010-10-11 17:52:10 -07:00
Aaron Patterson cecccf1156 we should always cast the value based on the column 2010-10-11 13:35:58 -07:00
Aaron Patterson bef5b826e3 removing freeze 2010-10-11 13:02:36 -07:00
Marcelo Giorgi 1c9022de21 Honor distinct option when used with count operation after group clause [#5721 state:resolved] 2010-10-11 09:39:34 -07:00
Santiago Pastorino e0b76d6151 reorder removed in favor of except(:order).order 2010-10-11 11:54:46 -02:00
Xavier Noria 21a92b8d01 Merge branch 'master' of git://github.com/lifo/docrails 2010-10-11 12:06:21 +02:00
José Valim a8b1780410 Updated DOCS for engines and added a couple TODOs. Also, commented internal railties rake tasks description. 2010-10-11 10:29:31 +02:00
Nathan Zook and Ryan Bigg 9074e8c644 Updated RUNNING_UNIT_TESTS documentation with mention of the build_databases rake tasks. 2010-10-11 11:15:38 +11:00
wycats cc8e386d08 Always pull in version for frameworks (standardize autoload / require / none) 2010-10-10 16:12:04 -07:00
Piotr Sarnacki 8636f64def Rename rake railties:copy_migrations to rake railties:install:migrations and fix it to work with new copying strategy 2010-10-09 21:32:34 +02:00
Piotr Sarnacki 022205be1d Add callback on skipped migration while copying migrations 2010-10-09 21:32:34 +02:00
Piotr Sarnacki 4377f8eba2 Change the method for copying migrations, do not add scope.
The purpose of this change is to allow copying fail on the same names.
Migrations change database and they should be treated with caution,
if 2 migrations are named the same it's much better to skip migration
and allow user decide if it should be copied or not.
2010-10-09 21:32:34 +02:00
Aaron Patterson 740d7e5aa2 removing false comment 2010-10-07 16:40:15 -06:00
Xavier Noria db520042b3 Merge branch 'master' of git://github.com/lifo/docrails 2010-10-06 23:16:13 +02:00
Hemant Kumar 2a04110f26 fix ruby 1.9 deadlock problem, fixes #5736 add connection pool tests 2010-10-06 14:45:56 -06:00
José Valim d649bf158b Provide a cleaner syntax for paths configuration that does not rely on method_missing. 2010-10-06 17:20:15 +02:00
Aaron Patterson e7d860c6be create fewer objects, call fewer methods in extract_pg_identifier_from_name 2010-10-04 15:25:20 -07:00
Aaron Patterson d8135eb452 * + flatten is not required in >= Ruby 1.8.7 2010-10-04 15:19:27 -07:00
Aaron Patterson 69a2c6b041 converting inject([]) to map 2010-10-03 16:42:08 -07:00
Aaron Patterson 365c93b7cd speed up duplicate migration detection 2010-10-03 16:39:48 -07:00
Aaron Patterson 40761c4bf3 reduce the number of calls to camelize 2010-10-03 16:36:43 -07:00
Aaron Patterson e6583901e5 convertion MigrationProxy to a Struct, initialize instance variables 2010-10-03 16:32:27 -07:00
Aaron Patterson 341e71a1b9 dry up some migration logic 2010-10-03 16:23:07 -07:00
Aaron Patterson 8beda11fd3 no need to differentiate between nil and false in this case 2010-10-03 16:13:45 -07:00
Aaron Patterson 5154a464cc lengths will be nil or an array 2010-10-03 15:35:56 -07:00
Aaron Patterson 7836616a64 remove a few function calls 2010-10-03 15:18:32 -07:00
Aaron Patterson bd78d24bd8 be kind to the garbage collector and reuse our visitor object 2010-10-03 14:40:06 -07:00
Aaron Patterson 83633b807a avoid creating objects when we can 2010-10-03 14:40:06 -07:00
José Valim 50215f9525 Rely on Rack::Session stores API for more compatibility across the Ruby world. 2010-10-03 21:24:22 +02:00
Carlos Antonio da Silva 4e93179ed3 Refactor AssociationCollection#include? with objects in memory
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-10-02 08:40:38 +02:00
Evgeniy Dolzhenko ee31847a5a Fix serialization :include option name 2010-10-01 14:26:17 +04:00
Aaron Patterson 45edeed1ee Arel::Sql::Engine.new does not do anything anymore 2010-09-30 16:28:12 -07:00
Aaron Patterson 0238228e5d type_name should check for blank because people may have messed up databases 2010-09-30 16:03:05 -07:00
Aaron Patterson 15419a5dc6 build_where should be private 2010-09-30 14:37:09 -07:00
Aaron Patterson fb4ee9c7e5 type_name is never a blank string, so use faster .nil? call 2010-09-30 14:37:04 -07:00
Marcelo Giorgi ef6df93a8d AssociationCollection#include? working properly for objects added with build method [#3472 state:resolved] 2010-09-30 12:13:52 -07:00
Aaron Patterson 505b532605 speeding up object instantiation by eliminating instance_eval 2010-09-30 12:13:12 -07:00
Aaron Patterson a8a62f87f6 [#5441 state:resolved] refactoring code to determine aggregate column 2010-09-30 10:17:38 -07:00
Aaron Patterson cc18034c8c group clause must be more specific 2010-09-30 10:17:34 -07:00
oleg dashevskii ab9622ee62 Tests proving #5441 2010-09-30 10:17:29 -07:00
yalab 91deff08c9 Fix 'rake db:create' is ignore encoding when using postgres [#5717 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-30 13:53:06 -03:00
Piotr Sarnacki f851352318 Added config.app_generators to allow configuring application's generators from railties.
With config.generators becomes a way to configure generators
for current instance only. For example:

module Blog
  class Engine < Rails::Engine
    config.generators do |g|
      g.orm :active_record
    end

    config.app_generators do |g|
      g.test_framework :rspec
    end
  end
end

such definition sets :active_record as orm for engine and :rspec
as test_framework for application. The values set with app_generators
can be overwritten in application using config.generators as you would
normally do:

module MyApp
  class Application < Rails::Application
    config.generators do |g|
      g.test_framework :test_unit
    end
  end
end
2010-09-30 09:47:06 +02:00
Neeraj Singh 396f3a28f1 double negative is not good 2010-09-30 08:11:36 +08:00
Neeraj Singh 299e9f6927 no need of nil check 2010-09-29 16:43:00 -07:00
Emilio Tagua 61cf11247b Use detect instead select to avoid "sh: [mysqldump]: command not found".
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-29 20:29:51 +02:00
Aaron Patterson 5793d5e002 eliminating method_missing on TableDefinition 2010-09-29 11:18:43 -07:00
Aaron Patterson b9215273a9 DRY up postgresql quote logic 2010-09-29 10:36:33 -07:00
Aaron Patterson 4350a5c73f fixing where clause indentation 2010-09-29 10:36:33 -07:00
Aaron Patterson 5e77872ac9 use consistent method calls for column inspection 2010-09-29 10:36:33 -07:00
Aaron Patterson df9abfab6f require pg when this adapter is loaded 2010-09-29 10:36:33 -07:00
Aaron Patterson b5b7f2e442 only reopen ConnectionAdapters once 2010-09-29 10:36:33 -07:00
Aaron Patterson b2979117e0 use inheritence to deal with custom methods 2010-09-29 10:36:32 -07:00
Aaron Patterson 2cc4b7f297 fisting test organization 2010-09-29 10:36:32 -07:00
Aaron Patterson 995ad3b378 just use if rather than nil? 2010-09-29 10:36:32 -07:00
Aaron Patterson b3c7766df7 just require sqlite3 when the database adapter is required 2010-09-29 10:36:32 -07:00
Aaron Patterson dec3a759d1 removing more useless code! yay! 2010-09-28 17:32:38 -07:00
Aaron Patterson 8d9f7b5b99 SqlLiteral is a string, so we can dry up these conditionals 2010-09-28 17:31:31 -07:00
Aaron Patterson b50b1ef9e8 shorten up or sql literal creation statements 2010-09-28 17:12:19 -07:00
Aaron Patterson 39d98e5c09 we only care about arrays and strings 2010-09-28 17:05:32 -07:00
Aaron Patterson 957e6fbe2a dry up calls to arel.join() 2010-09-28 17:03:36 -07:00
Aaron Patterson ef2392f60b removing unused lasgns 2010-09-28 16:59:38 -07:00
Aaron Patterson e6ca7e7197 refactoring to remove crazy logic 2010-09-28 16:14:39 -07:00
Aaron Patterson c2cad2d97e where_values_hash always returns a hash 2010-09-28 15:56:08 -07:00
Neeraj Singh 3f16103daf performance improvement based on discussion at fbd1d306b9
Credit goes to all the participants in the discussion
2010-09-28 15:52:26 -07:00
Aaron Patterson 9b89a436e5 Revert "porting 515917f5d8 to master"
This reverts commit bee447a5b9.
2010-09-28 15:51:07 -07:00
Aaron Patterson 16f5d29755 Revert "porting 0665182950 to master. Thanks Marcelo Giorgi"
This reverts commit 9eca11a4a5.
2010-09-28 15:51:00 -07:00
Aaron Patterson 10041e2d45 removing a conditional that is not used 2010-09-28 15:39:24 -07:00
Aaron Patterson d0fb0d770f fisting the postgresql tests 2010-09-28 15:32:12 -07:00
Marcelo Giorgi cdfd013dd7 Set attributes properly for model built from association with conditions [#5562 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-28 15:22:50 -03:00
Aaron Patterson 2fc5c6333b each works well too 2010-09-28 10:43:18 -07:00
Aaron Patterson e001ea0940 no need for splat and flatten 2010-09-28 10:40:43 -07:00
Aaron Patterson 9b561ab029 avoid calling to_sql when we can 2010-09-28 10:37:35 -07:00
Aaron Patterson bf2223d0e0 removing an inject + merge in favor of Hash#[] 2010-09-28 10:30:42 -07:00
Aaron Patterson 75e52df0e8 fixing indentation warning 2010-09-28 10:26:32 -07:00
Étienne Barrié 8b8730e139 Test add_index and remove_index with a symbol name #4891 2010-09-28 10:06:57 -07:00
Aaron Patterson 9eca11a4a5 porting 0665182950 to master. Thanks Marcelo Giorgi 2010-09-28 10:04:33 -07:00
Aaron Patterson bee447a5b9 porting 515917f5d8 to master 2010-09-28 10:02:03 -07:00
Aaron Patterson b7934afe32 use new skool Ruby instead of Ruby Classic™ 2010-09-27 18:55:28 -07:00
Aaron Patterson 7752b2fa62 be kind to the garbage collector: only instantiate objects when absolutely necessary 2010-09-27 18:07:35 -07:00
Aaron Patterson 526ade1ff6 adding test cases for the dynamic finder matcher match method 2010-09-27 17:59:28 -07:00
Aaron Patterson 65d74312c8 constructor should not do so much work; avoid allocating object if possible 2010-09-27 17:38:49 -07:00
Aaron Patterson 133742d185 @klass also uses DynamicFinderMatch, so no need for it on the relation 2010-09-27 16:51:12 -07:00
Aaron Patterson b1f5e90839 no need for a case / when statement 2010-09-27 16:20:46 -07:00
Aaron Patterson f6ef4d383e do not need intermediate variable, avoid lasgn 2010-09-27 16:20:46 -07:00
Aaron Patterson ff5b3f5c3a DRY up our regular expression 2010-09-27 16:20:46 -07:00
Aaron Patterson 9e652b65c2 reduce method calls in the dynamic finder matcher 2010-09-27 16:20:46 -07:00
Aaron Patterson f22b40a8f2 make sure we use the engine assigned to the table when quoting 2010-09-27 14:29:07 -07:00
Neeraj Singh 4966b915fe Fix for #5579 involved the code change for both has_one and has_many relationships. The path included test only for has_one. This patch adds test for has_many relationship.
[#5706 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-27 23:11:26 +02:00
Neeraj Singh 7f743233c4 Fix for nested_attributes with has_many association fails when a single record is being updated.
[#5705 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-27 23:11:24 +02:00
José Valim fe0251e408 Merge remote branch 'miloops/warnings'
Conflicts:
	actionpack/lib/action_controller/metal/url_for.rb
2010-09-27 21:00:54 +02:00
Aaron Patterson e1b51955f1 adding a test for slug behavior 2010-09-27 11:33:35 -07:00
Neeraj Singh fbd1d306b9 Three performance improvements:
* for simple cases like User.last and User.order('name desc').last no need to perform Array#join operation.

* Instead of performing String#blank? do Array#empty?

* no need to create variable relation
2010-09-27 10:49:49 -07:00
Aaron Patterson e3d6434dd9 depending on arel 2.0.0 2010-09-27 09:27:39 -07:00
Emilio Tagua eff68d86ad Prevent shadowing outer local variable. 2010-09-27 11:19:19 -03:00
Aaron Patterson 7918a5c966 third parameter is not used 2010-09-26 18:25:13 -07:00
Nic Benders f8c7f4cc53 db:structure:dump should list current Rails.env adapter in errors, not always the test adapter
[#5710 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-26 20:45:30 -03:00
Tim Connor d6f7b7d353 Fix remove_index issue when provided :name is a symbol
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-26 20:40:14 -03:00
Piotr Sarnacki 7acf64a81b Add namespacing for observer generator
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 17:28:10 +02:00
Piotr Sarnacki 00aa13bc0e Generators fix: properly check if module should be created when creating a namespaced model
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-25 10:46:22 +02:00
Marcelo Giorgi 72543b2e63 Delegate ActiveRecord::Base.offset to scoped methods (analogous to limit) [#5688 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-24 20:24:54 -03:00
Brian Candler a348ffcb2d Fix warning message when db/schema.rb doesn't exist [#5625 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-24 17:40:03 -03:00
Piotr Sarnacki bac0826b1f Refactor namespaced generators to use module_namespacing block helper
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-24 21:02:30 +02:00
Piotr Sarnacki e83634081a Generators are not aware of namespace of isolated engines and applications
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-24 21:02:24 +02:00
tnp 55b6fa9370 restore behavior of touch for models without :updated_xx [#5439 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-24 20:42:38 +02:00
Neeraj Singh 097240f602 reject_id option should be respected while using nested_attributes
[#5579 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-24 12:46:24 +02:00
Aaron Patterson afdf86e8ee Hash#to_s behaves differently between 1.8 and 1.9, so adjust accordingly 2010-09-23 08:48:10 -07:00
Aaron Patterson a4dd0b3433 switch present in favor of empty 2010-09-22 16:14:46 -07:00
Aaron Patterson 0a515dc68d testing poor behavior of hash serialization 2010-09-22 14:58:29 -07:00
Emilio Tagua f6de806537 Refactor association_collection uniq method.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:02 -03:00
Emilio Tagua 2da809da37 No need to use inject here.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:02 -03:00
Emilio Tagua ea35ccfe20 Perf: refactor method.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:02 -03:00
Emilio Tagua 0580f5a6ac No need to use inject here, use map instead.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:02 -03:00
Emilio Tagua 4513cc142c Goodbye inject, hello map.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:02 -03:00
Emilio Tagua 569be76ed6 Use map instead inject.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 18:08:02 -03:00
Santiago Pastorino 090c9ae3a3 Missing the mysql2 gem here 2010-09-22 14:33:44 -03:00
Neeraj Singh 48a108d55b Error message should advice to use 'mysql2' gem.
If I create a new app using command
rails new demo -d mysql
then Gemfile contains 'mysql2' gem by default.

However if mysql gem is missing then error message says
raise "!!! Missing the mysql gem. Add it to your Gemfile: gem 'mysql', '2.8.1'"

[#5569 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-22 14:20:56 -03:00
Aaron Patterson 0cf45c850c avoid a proc object 2010-09-22 09:01:11 -07:00
Aaron Patterson fe8a307088 avoid creating a range object 2010-09-22 09:01:11 -07:00
Aaron Patterson aa85a7a7e7 drying up construct_association 2010-09-21 21:01:48 -07:00
Aaron Patterson 8186c5736b dry up some conditionals 2010-09-21 20:44:21 -07:00
Aaron Patterson 723adecab9 fixing case / when indentation 2010-09-21 20:38:36 -07:00
Aaron Patterson 9b1a4fda6f fix case / when indentation 2010-09-21 20:32:11 -07:00
Aaron Patterson 27be777888 avoid a hash lookup 2010-09-21 20:32:00 -07:00
Aaron Patterson e66bf6f5e3 remove more codes 2010-09-21 19:56:53 -07:00
Aaron Patterson 9b81ae6969 deleting more code 2010-09-21 19:41:15 -07:00
Aaron Patterson 8d6a6b250e use each properly to avoid splatting a variable 2010-09-21 19:37:07 -07:00
Aaron Patterson 19ff42d909 deleting repeated codes 2010-09-21 19:27:23 -07:00
Aaron Patterson 79ef26c8c9 do not pass nil values to arel 2010-09-21 19:22:37 -07:00
Aaron Patterson 31eb765640 refacoring duplicate code. <3 <3 <3 2010-09-21 16:50:22 -07:00
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