Commit Graph

2237 Commits

Author SHA1 Message Date
Hemant Kumar
2a04110f26 fix ruby 1.9 deadlock problem, fixes #5736 add connection pool tests 2010-10-06 14:45:56 -06: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
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
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
Aaron Patterson
5793d5e002 eliminating method_missing on TableDefinition 2010-09-29 11:18:43 -07:00
Aaron Patterson
2cc4b7f297 fisting test organization 2010-09-29 10:36:32 -07:00
Aaron Patterson
9b89a436e5 Revert "porting 515917f5d8 to master"
This reverts commit bee447a5b9.
2010-09-28 15:51:07 -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
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
bee447a5b9 porting 515917f5d8 to master 2010-09-28 10:02:03 -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
133742d185 @klass also uses DynamicFinderMatch, so no need for it on the relation 2010-09-27 16:51:12 -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
Aaron Patterson
e1b51955f1 adding a test for slug behavior 2010-09-27 11:33:35 -07: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
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
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
0a515dc68d testing poor behavior of hash serialization 2010-09-22 14:58:29 -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
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
Tim Connor
37de59eacf Fix issue with remove_index and add unit test [#5645 state:resolved] 2010-09-18 20:49:31 +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
a11dd8ac87 specific number of spaces should not be enforced 2010-09-10 11:51:32 -07: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
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
Emilio Tagua
e3246ef5b5 Add tests for Relation#only. 2010-09-09 15:27:10 -03:00
Aaron Patterson
c6015cbcd8 serialized attributes should be serialized before validation [#5525 state:resolved] 2010-09-07 13:39:27 -07:00
Jakub Suder
2524cf404c fixed some issues with JSON encoding
- as_json in ActiveModel should return a hash
  and handle :only/:except/:methods options
- Array and Hash should call as_json on their elements
- json methods should not modify options argument

[#5374 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-09-07 11:33:10 -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
Carlos Antonio da Silva
9b610049bb Cleanup deprecation warnings in active record
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-06 13:39:55 +02:00
Nick Ragaz
16e078d908 failing test for reorder overriding default_scope
[5528]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-05 08:27:51 -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
Piotr Sarnacki
e063879daf Fix copying migrations to empty directory 2010-09-03 22:59:10 +02:00
Piotr Sarnacki
75f8ac6ea7 Implemented ActiveRecord::Migrations#copy based on James Adam's idea
ActiveRecord::Migration#copy allows to copy migrations from one place
to another, changing migrations versions and adding scope to filename.

For example:
ActiveRecord::Migration.copy("db/migrate",
        :blog_engine => "vendor/gems/blog/db/migrate")

will copy all migrations from vendor/gems/blog/db/migrate to db/migrate
with such format:

Versions of copied migrations will be reversioned to be appended after
migrations that already exists in db/migrate
2010-09-03 22:59:09 +02:00
Ken Collins
d28438caf2 A few schema changes for the SQL Server adapter.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2010-09-03 14:57:16 +12:00
Andrew White
4e67bf26aa Reset default scope in Thread.current when class is unloaded [#5497 state:resolved]
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-09-01 22:32:41 +02:00
Emilio Tagua
2ce57fd0d9 Fix test: this should return 0 not 7, since Arel was ignoring select clause and now it's fixed.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-01 15:09:38 +02:00
Subba Rao Pasupuleti
dba4efbd0e nested attributes tests should rely on associated objects to verify results not on assert_difference [#5206 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-01 09:56:48 +02:00