Michael Koziarski
c48f744400
Make sure that belongs_to counter decrements when assigning nil Closes #10804 [jeanmartin]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8735 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-26 06:23:03 +00:00
Michael Koziarski
176abc842c
Add tests and documentation for allow_blank. Closes #10651 [blj]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8733 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-26 05:08:20 +00:00
Michael Koziarski
a91b7f1975
require test/unit explicitly otherwise the at_exit handler doesn't get called [jbarnette]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8690 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-22 08:32:50 +00:00
Jeremy Kemper
32b36b8936
Add missing author_addresses.yml fixture. Closes #10592 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8682 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-21 17:21:12 +00:00
Jeremy Kemper
39814fcce0
Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/rails
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-21 17:20:51 +00:00
Jeremy Kemper
16b129a68c
belongs_to supports :dependent => :destroy and :delete. Closes #10592 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8675 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 05:30:42 +00:00
Jeremy Kemper
355a8ff2cd
Introduce preload query strategy for eager :includes. Closes #9640 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8672 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 04:19:53 +00:00
Jeremy Kemper
abdf546ad6
Support aggregations in finder conditions. Closes #10572 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8671 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 03:45:24 +00:00
Jeremy Kemper
aae37bb4f7
Extract ActiveSupport::Callbacks from Active Record, test case setup and teardown, and ActionController::Dispatcher. Closes #10727 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8664 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 02:44:45 +00:00
Jeremy Kemper
1e70928014
Fix paths
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8661 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:31:37 +00:00
Jeremy Kemper
42b39ae3f2
Move tests to cases
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:30:42 +00:00
Jeremy Kemper
105a27f39e
move schema
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8659 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:29:00 +00:00
Jeremy Kemper
e899a83a85
move migrations
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8658 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:28:07 +00:00
Jeremy Kemper
43b81d01d0
move assets and models
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:27:03 +00:00
Rick Olson
49794485b6
Ensure that modifying has_and_belongs_to_many actions clear the query cache. Closes #10840 [john.andrews]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8653 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 01:55:11 +00:00
Michael Koziarski
61e550ade9
Don't ignore :precision and :scale when adding columns on postgresql. Closes #6868 [w.piekutowski]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8647 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-16 03:54:15 +00:00
Rick Olson
ebfd03b938
Fix issue where Table#references doesn't pass a :null option to a *_type attribute for polymorphic associations. Closes #10753 [railsjitsu]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8627 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-11 19:54:19 +00:00
Jeremy Kemper
8f7fa55e8d
Fixtures: removed support for the ancient pre-YAML file format. Closes #10736 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8594 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-08 03:54:40 +00:00
Jeremy Kemper
ebe3a0d532
More thoroughly quote table names. Exposes some issues with sqlite2 adapter. Closes #10698 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 14:58:28 +00:00
Jeremy Kemper
139b92495f
* Continue evolution toward ActiveSupport::TestCase and friends. #10679 [Josh Peek]
...
* TestCase: introduce declared setup and teardown callbacks. Pass a list of methods and an optional block to call before setup or after teardown. Setup callbacks are run in the order declared; teardown callbacks are run in reverse. [Jeremy Kemper]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8570 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:34:15 +00:00
Jeremy Kemper
c36f8111a6
pdate_all ignores scoped :order and :limit, so post.comments.update_all doesn't try to include the comment order in the update statement. Closes #10686 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8554 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-04 03:19:50 +00:00
Jeremy Kemper
25db1fc201
Ruby 1.9 compat: test multibyte chars proxy for 1.8 only
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8553 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-04 03:19:20 +00:00
David Heinemeier Hansson
424c330634
Added by parameter to increment, decrement, and their bang varieties so you can do player1.increment!(:points, 5) ( closes #10542 ) [Sam]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8534 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-03 00:30:22 +00:00
Jeremy Kemper
20d29b3797
Ruby 1.9 compat: introduce ActiveSupport::FrozenObjectError normalize TypeError vs RuntimeError handling. Closes #10645 [Frederick Cheung]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-29 19:43:07 +00:00
Rick Olson
0e3a54a3b9
Don't unnecessarily load has_many associations in after_update callbacks. Closes #6822 [stopdropandrew, canadaduane]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-28 18:01:22 +00:00
Jeremy Kemper
7555073803
Ruby 1.9 compat: introduce instance_variable_names. Closes #10630 [Frederick Cheung]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8499 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-28 05:42:12 +00:00
Jeremy Kemper
f013e047ef
Ruby 1.9 compat: don't modify iterator target within block
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8487 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-27 11:16:51 +00:00
Jeremy Kemper
240b4c527e
Ruby 1.9 compat: attribute methods
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8486 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-27 11:16:39 +00:00
Jeremy Kemper
8b5f4e474f
Ruby 1.9 compat: fix warnings, shadowed block vars, and unitialized instance vars
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-22 11:26:03 +00:00
Jeremy Kemper
f6379bfe15
Eager belongs_to :include infers the foreign key from the association name rather than the class name. Closes #10517 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8456 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-21 01:49:01 +00:00
Jeremy Kemper
15b38efde8
Benchmark logs for any level below or equal to the one specified, rather than just equal. Closes #10580 [Dan Manges]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8455 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-21 01:48:20 +00:00
Jeremy Kemper
b72763a96f
SQLite: fix rename_ and remove_column for columns with unique indexes. Closes #10576 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8453 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-20 22:28:12 +00:00
Rick Olson
5dc831fd9a
add passing test for Test::Unit subclasses running #setup properly [brynary]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-19 22:49:27 +00:00
Jeremy Kemper
0b84af9599
Revert [8392]. Closes #10568 , reopens #10379 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8442 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-19 21:16:27 +00:00
Rick Olson
ce102e3af9
Ensure optimistic locking handles nil #lock_version values properly. Closes #10510 [rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8395 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-15 01:45:30 +00:00
Rick Olson
abd7cf343c
Make the Fixtures Test::Unit enhancements more supporting for double-loaded test cases. Closes #10379 [brynary]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8392 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-15 01:23:05 +00:00
Rick Olson
d98728e091
Fix that validates_acceptance_of still works for non-existent tables (useful for bootstrapping new databases). Closes #10474 [hasmanyjosh]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8377 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-12 23:55:14 +00:00
Rick Olson
66e97c34c1
Ensure that the :uniq option for has_many :through associations retains the order. #10463 [remvee]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8376 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-11 20:08:30 +00:00
Jeremy Kemper
f67add4283
Base.exists? doesn't rescue exceptions to avoid hiding SQL errors. Closes #10458 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8375 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-11 01:53:54 +00:00
Jeremy Kemper
b1ce7e4d4a
Ruby 1.9 compat: File.exists\? -> File.exist\? en masse. References #1689 [Pratik Naik]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8365 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 05:54:46 +00:00
Jeremy Kemper
d0f192cd75
Remove empty ar_joins_test
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8353 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 01:37:11 +00:00
Jeremy Kemper
220a64e9b6
post.comments.reload returns the association rather than the result of load_target. Closes #10438 [Fred Cheung]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8347 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 01:07:04 +00:00
Geoff Buesing
2766f7629f
Anchor DateTimeTest to fixed DateTime instead of a variable value based on Time.now#advance#to_datetime. Works around issue on 64-bit platforms with Ruby's Time#to_datetime respecting fractional seconds, and database adapters not respecting them for DateTimes, throwing off before-and-after-save equality test. References #10080 , #10073
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-07 03:00:50 +00:00
David Heinemeier Hansson
e16ecaf84c
Fixed that the truncation of strings longer than 50 chars should use inspect so newlines etc are escaped ( closes #10385 ) [norbert]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8319 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-06 00:01:11 +00:00
Jeremy Kemper
52fe604da3
Fix eager association test. Closes #10381 [alexey]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 22:06:26 +00:00
David Heinemeier Hansson
6fd1a4d502
Fixed that habtm associations should be able to set :select as part of their definition and have that honored [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8309 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 21:37:51 +00:00
David Heinemeier Hansson
2af36bbbd4
Fix typos ( closes #10378 )
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 18:54:41 +00:00
David Heinemeier Hansson
37b1d33ba3
Try again
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8273 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 02:50:18 +00:00
Jeremy Kemper
e7dab3b166
MySQL: we can't distinguish a fake 0 default in 4.x
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 02:46:28 +00:00
David Heinemeier Hansson
a5fded3e88
Fix that options[:from] table names should never be quoted [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8270 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 02:30:30 +00:00