Aaron Patterson
2e748feb80
just use the list of column names to generate attribute methods
2011-02-18 10:47:19 -08:00
Jon Leighton
1644663ba7
Split AssociationProxy into an Association class (and subclasses) which manages the association, and a CollectionProxy class which is *only* a proxy. Singular associations no longer have a proxy. See CHANGELOG for more.
2011-02-18 00:00:13 +00:00
Jon Leighton
1d9f26ed47
Add :nodoc: to ThroughAssociation and HasOneAssociation
2011-02-18 00:00:13 +00:00
Jon Leighton
91fd651056
Allow building and then later saving has_many :through records, such that the join record is automatically saved too. This requires the :inverse_of option to be set on the source association in the join model. See the CHANGELOG for details. [ #4329 state:resolved]
2011-02-18 00:00:13 +00:00
Jon Leighton
f0b9805029
Ensure that association_ids uses the correct attribute where the association is a has_many :through with a :primary_key option on the source reflection. [ #6376 state:resolved]
2011-02-18 00:00:13 +00:00
Ben Orenstein
b131cfba05
Remove unused line in test setup.
...
[#6442 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-17 14:38:51 -02:00
Aaron Patterson
9c023cc4d2
explicitly allowing lolqueries
2011-02-16 15:11:48 -08:00
Aaron Patterson
ceb2f0f216
use the arel table rather than generating strings
2011-02-16 11:46:55 -08:00
Aaron Patterson
1dea7b5a61
no need for Array.wrap
2011-02-16 11:22:30 -08:00
Aaron Patterson
2e2e58a6a3
fixing whitespace problems
2011-02-16 11:08:01 -08:00
Steven Fenigstein
9b188c5bfe
removed an unnecessary second query when passing an ActiveRecord::Relation to a where clause. And added ability to use subselects in where clauses.
2011-02-16 09:54:09 -08:00
Timothy N. Tsvetkov
c6fac7b449
Fixed issue #6363 , avoid to pluralized already pluralized names and singularize a single in generators, for example stadia is a valid plural for stadium. But calling pluralize for stadia will return stadias which sematically is not corrent in this case
...
[#6363 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-16 15:09:06 -02:00
Dan Pickett
1754bd9b20
handle double pluralization for irregular plurals
...
[#6363 ]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-16 15:08:25 -02:00
Ben Orenstein
2eed9286ce
Remove unused code.
...
[#6437 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-16 13:20:04 -02:00
Aaron Patterson
8276a24020
fixture methods can be overridden and super() is useful
2011-02-15 15:52:27 -08:00
Aaron Patterson
8c4c07e4cb
fixing variable names to reflect reality
2011-02-15 15:35:10 -08:00
Aaron Patterson
13e72db770
this is in the AR namespace, so AR must exist
2011-02-15 15:05:52 -08:00
Joel Nimety
ef57334210
GcTime incorrectly checks GC.respond_to?(:total_time), it should check GC::Profiler.respond_to?(:total_time)
...
[#6435 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-15 20:13:06 -02:00
Timothy N. Tsvetkov
09ccdc3737
Optimization for postgres adapter for add_column method. Set default and not null in one query
2011-02-15 10:52:14 -08:00
Aaron Patterson
f83218561e
fixing variable names, removing FixtureFile instances from test ivars
2011-02-15 10:48:01 -08:00
Aaron Patterson
f0b1173965
removing unused variable
2011-02-15 10:07:19 -08:00
Ken Mazaika
1bedee5631
ActiveResource validation tests did not test ActiveModel validations. Adjust the test to be done the Rails3 way.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-15 12:04:42 -02:00
Sergii Boiko
471327169d
fixed broken link to postgresql docs
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-15 12:01:15 -02:00
Aaron Patterson
c9f1ab5365
bad tests are bad
2011-02-14 17:10:14 -08:00
Aaron Patterson
02fc45a057
remove accidental raise!
2011-02-14 16:48:18 -08:00
Aaron Patterson
e4dac4750d
removing irrelevant test
2011-02-14 16:01:47 -08:00
Aaron Patterson
fab9c2eaaa
Merge branch 'fixtures'
...
* fixtures:
remove unused methods
extract database activity out of Fixtures instances
extract rows that should be inserted to a method
fixtures will return a list of tables that may be effected, delete existing fixtures will delete those tables
2011-02-14 14:55:25 -08:00
Aaron Patterson
f9ea47736e
remove unused methods
2011-02-14 14:55:01 -08:00
Aaron Patterson
fd81c700ec
extract database activity out of Fixtures instances
2011-02-14 14:53:42 -08:00
Aaron Patterson
ca05016765
extract rows that should be inserted to a method
2011-02-14 12:01:22 -08:00
Aaron Patterson
0123ceb9cd
Merge remote branch 'jonleighton/association_fixes'
...
* jonleighton/association_fixes:
Add a transaction wrapper in add_to_target. This means that #build will now also use a transaction. IMO this is reasonable given that the before_add and after_add callbacks might do anything, and this great consistency allows us to abstract out the duplicate code from #build and #create.
Inline ensure_owner_is_persisted! as it is only called from one place
@target should always be an array
Rename add_record_to_target_with_callbacks to add_to_target
Don't pass the block through build_record
Move create and create! next to build
Get rid of create_record as it is not only used in one place
Get rid of AssociationCollection#save_record
Fix test/cases/connection_pool_test.rb for sqlite3 in-memory db
Add interpolation of association conditions back in, in the form of proc { ... } rather than instance_eval-ing strings
2011-02-14 11:51:56 -08:00
Aaron Patterson
2487aab99a
fixtures will return a list of tables that may be effected, delete existing fixtures will delete those tables
2011-02-14 11:25:19 -08:00
Aaron Patterson
6f4e3ffd0f
HabtmFixtures class is no longer needed
2011-02-14 10:07:05 -08:00
Andrew White
ccc678b49e
Add test to prevent regression on namespace root nested in a resource
...
[#6389 state:resolved]
2011-02-14 06:12:22 +00:00
Andrew White
460a341682
Fix named route helper for routes nested inside deeply nested resources
...
[#6416 state:resolved]
2011-02-14 02:56:09 +00:00
Jon Leighton
b9ea751d0e
Add a transaction wrapper in add_to_target. This means that #build will now also use a transaction. IMO this is reasonable given that the before_add and after_add callbacks might do anything, and this great consistency allows us to abstract out the duplicate code from #build and #create.
2011-02-14 01:40:31 +00:00
Jon Leighton
5d6d669bfe
Inline ensure_owner_is_persisted! as it is only called from one place
2011-02-14 01:40:31 +00:00
Jon Leighton
c9b685e681
@target should always be an array
2011-02-14 01:40:31 +00:00
Jon Leighton
db03308451
Rename add_record_to_target_with_callbacks to add_to_target
2011-02-14 01:40:31 +00:00
Jon Leighton
641a3068ea
Don't pass the block through build_record
2011-02-14 01:40:31 +00:00
Jon Leighton
686418c657
Move create and create! next to build
2011-02-14 01:40:31 +00:00
Jon Leighton
b93d2189c4
Get rid of create_record as it is not only used in one place
2011-02-14 01:40:31 +00:00
Jon Leighton
7ce7ae0c8b
Get rid of AssociationCollection#save_record
2011-02-14 01:40:31 +00:00
Jon Leighton
eab5fb49f8
Fix test/cases/connection_pool_test.rb for sqlite3 in-memory db
2011-02-14 01:40:31 +00:00
Jon Leighton
a7e19b30ca
Add interpolation of association conditions back in, in the form of proc { ... } rather than instance_eval-ing strings
2011-02-14 01:40:31 +00:00
Andrew White
fd7605826a
Add notes on how to override the default :id constraint [ #5994 state:resolved]
2011-02-14 01:01:20 +00:00
Andrew White
48fe62ee57
Remove incorrect assert_recognizes example
2011-02-14 00:09:05 +00:00
Andrew White
af4fab7d2e
Remove incorrect assert_recognizes example
2011-02-13 23:25:57 +00:00
Andrew White
385be358cf
Fix assert_recognizes with block constraints [ #5805 state:resolved]
2011-02-13 23:24:46 +00:00
Santiago Pastorino
9143032a10
Add missing require
2011-02-13 02:38:31 -02:00