Jamis Buck
d364164763
Schema dumper should emit ":default => false" if the default for a column is false
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2464 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-05 13:37:00 +00:00
David Heinemeier Hansson
810ebf7c6a
Forced newer versions of RedCloth to use hard breaks [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2436 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-02 20:21:43 +00:00
Jeremy Kemper
e19bd169fa
Association validation does not belong in a before_save callback: move it into a validation method. Restores the expected model.valid? == model.save. Add tests for cancelling save by returning false from a before_save callback. Remove assumption that before_destroy's return value indicates whether the record was destroyed.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-02 02:00:50 +00:00
Jeremy Kemper
f98ec352b6
Get rid of old symbolize_strings_in_hash.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2427 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-30 12:10:04 +00:00
Jeremy Kemper
ee5fe97ac4
Ticket #2282 - fix parsing of timestamps with time zone
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2426 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-30 12:09:13 +00:00
Jeremy Kemper
3f1aad8ac9
No need to string.to_s right after checking that string.is_a?(String)
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2418 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-30 04:34:07 +00:00
Jeremy Kemper
e828657973
Move transaction thread-safety test to transactions_test. Check that simultaneous transactions don't step on each others' toes. Check that simultaneous transactions don't give dirty reads (read-committed txn isolation or greater.)
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2417 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-30 03:39:15 +00:00
Jeremy Kemper
4ce9b4c557
Use transactional fixtures by default for AR tests. Set ENV['AR_NO_TX_FIXTURES'] to yes to disable. Tidy up abstract_unit.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2416 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-30 01:00:04 +00:00
Jeremy Kemper
093a87d1a3
Require topic model rather than assume another test has already.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2415 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-30 00:58:26 +00:00
Jeremy Kemper
110360f858
Disable transactional fixtures for ar_schema_test and schema_test_postgresql
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2414 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-30 00:57:27 +00:00
Nicholas Seckar
6f38041133
Fix broken testcase for transactions
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2409 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-29 11:16:51 +00:00
Jeremy Kemper
67d1e0cd3d
Clean up and extend test coverage for validates_numericality_of
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2402 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-29 02:35:41 +00:00
Nicholas Seckar
fc83920383
Fix transactions so that calling return while inside a transaction will not leave an open transaction on the connection.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2398 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-28 18:53:22 +00:00
Marcel Molina
0d07152aab
Make schema definition column lookups agnostic w/r/t/ whether a key or symbol is passed. Fixes failing test in [2396].
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2397 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-28 18:07:18 +00:00
Marcel Molina
f43d97a860
Add failing test that shows that AR::Migration.remove_column fails silently with SQLite when passed arguments as symbols.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2396 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-28 17:50:28 +00:00
Jeremy Kemper
db8f727229
Ticket #2156 - Use foreign_key inflection uniformly
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2394 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-28 09:14:33 +00:00
Jeremy Kemper
dd21e9ae39
r3657@asus: jeremy | 2005-09-28 00:32:33 -0700
...
Also test that client.firm_id.nil? after firm.clients.clear when clients is not :dependent
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2385 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-28 04:00:59 +00:00
Jeremy Kemper
efaf2af07c
r3653@asus: jeremy | 2005-09-28 00:23:49 -0700
...
Ticket 2221 - model.association.clear should destroy associated objects if :dependent => true instead of nullifying their foreign keys
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2384 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-28 03:52:57 +00:00
Scott Barron
83b390bcfc
Returning false in before_destroy should cancel action. Closes #1829 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2381 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-28 00:09:50 +00:00
Jeremy Kemper
0bd11857ef
Ticket 2256 - Recognize PostgreSQL NOW() default as equivalent to CURRENT_TIMESTAMP/CURRENT_DATE
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2378 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-27 23:37:57 +00:00
Jeremy Kemper
fcd0133f69
Update change log for #2250 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2372 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-27 20:47:34 +00:00
Marcel Molina
b9fa3541b4
Add extensive documentation to the ActiveRecord::AbstractAdapter. #2250
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2371 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-27 20:37:23 +00:00
Jeremy Kemper
3fa38c4dba
Oops, swapped order of params to COALESCE! Upcoming patch has test cases.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2370 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-27 20:24:52 +00:00
Jeremy Kemper
64937891c7
r3632@asus: jeremy | 2005-09-27 12:18:49 -0700
...
reset_sequences cleanup also fixed #2183 ; credit ticket author
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2367 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-27 15:45:48 +00:00
Scott Barron
76a7a52557
Fix serialization problem with YAML in 1.8.3
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2360 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-27 09:25:17 +00:00
Jeremy Kemper
f5f7beb369
r3613@asus: jeremy | 2005-09-26 22:25:04 -0700
...
Handle sequence reset for empty tables and models with custom primary keys.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2357 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-27 01:51:05 +00:00
Jeremy Kemper
169785162c
r3605@asus: jeremy | 2005-09-26 19:10:50 -0700
...
Update change log.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2356 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 22:41:18 +00:00
Jeremy Kemper
6d7551f1bb
r3604@asus: jeremy | 2005-09-26 19:10:42 -0700
...
Treat validates_size_of :within as a single validator rather than splitting it into to ends of the range, thus yield two error messages on nil (yuck)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2355 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 22:41:02 +00:00
Jeremy Kemper
54adccda08
r3603@asus: jeremy | 2005-09-26 19:10:00 -0700
...
Add unit tests for nil assigned to validates_size_of :attr, :within
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2354 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 22:40:51 +00:00
Marcel Molina
1d738cab80
Make update_attribute use the same writer method that update_attributes uses.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2353 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 21:55:37 +00:00
Marcel Molina
1465f9cee2
Make migrations honor table name prefixes and suffixes.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2352 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 21:30:12 +00:00
Jeremy Kemper
0f276de512
r3597@asus: jeremy | 2005-09-26 17:39:23 -0700
...
Minor improvement to SQLite adapter blob escaping.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2351 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 21:04:36 +00:00
Jeremy Kemper
bbfde01b94
r3592@asus: jeremy | 2005-09-26 17:01:47 -0700
...
Update change log.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2349 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 20:29:11 +00:00
Jeremy Kemper
27ecb482c6
r3591@asus: jeremy | 2005-09-26 17:01:30 -0700
...
Simplify binary unit test. Use flowers.jpg instead of associations.png
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2348 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 20:29:06 +00:00
Jeremy Kemper
a5e2f6cd28
r3590@asus: jeremy | 2005-09-26 17:00:53 -0700
...
Correct and optimize PostgreSQL bytea escaping. This is a blend of four patches, each providing a bit to the solution.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2347 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 20:29:01 +00:00
Jeremy Kemper
79a535ecd7
r3589@asus: jeremy | 2005-09-26 16:58:40 -0700
...
Remove associations.png in favor of flower.jpg which reveals a bug in binary escaping.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2346 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 20:28:55 +00:00
Jeremy Kemper
a68557952f
r3569@asus: jeremy | 2005-09-26 05:33:09 -0700
...
Ticket 1749 - reset_sequences workaround for non-integer sequences
r3570@asus: jeremy | 2005-09-26 08:30:30 -0700
Fixtures.reset_sequences should only reset sequences corresponding to integer primary keys named id. #1749
r3571@asus: jeremy | 2005-09-26 08:31:11 -0700
Update change log.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2343 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 11:56:16 +00:00
Jeremy Kemper
b2c46ed5fd
Include the orders table in *.drop.sql
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2342 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 08:23:04 +00:00
Marcel Molina
b25933f296
Get rid of warnings generated by calling obsolete .to_a method on a Symbol
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2341 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 02:02:55 +00:00
Jamis Buck
c5f53ca333
Remove duplicate 'quote_column_name' definition
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2340 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-25 21:15:44 +00:00
David Heinemeier Hansson
b3df95985a
Refactored the AbstractAdapter to be a lot less scary. Cleaned up the docs and style for the OSS adapters
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2339 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-25 17:56:03 +00:00
Jamis Buck
ea65465422
Standardize the interpretation of boolean columns in the Mysql and Sqlite adapters. (Use MysqlAdapter.emulate_booleans = false to disable this behavior)
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2335 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-25 15:49:35 +00:00
Scott Barron
e7059fd281
Fix migrations with PG 7.x.
...
Closes #1850
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2332 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-25 10:52:16 +00:00
David Heinemeier Hansson
b2b0ace058
Okay, you can have an extra space
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2330 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-25 09:14:58 +00:00
David Heinemeier Hansson
6720efb8e3
Use assignment instead of call
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-25 08:50:47 +00:00
David Heinemeier Hansson
7f86e026f6
Use assignment instead of call
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2327 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-25 08:48:30 +00:00
David Heinemeier Hansson
948be2c998
Added new symbol-driven approach to activating observers with Base#observer [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-25 08:26:29 +00:00
Jamis Buck
2a35baa0bb
Wrap :conditions in parentheses to prevent problems with OR's #1871
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2324 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-24 23:58:13 +00:00
David Heinemeier Hansson
caaf40d535
Added AbstractAdapter#select_value and AbstractAdapter#select_values as convenience methods for selecting single values, instead of hashes, of the first column in a SELECT #2283
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2323 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-24 19:50:57 +00:00
David Heinemeier Hansson
66820a4aa7
Just include activerecord/schema with AR so it doesnt need to be dumped
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2322 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-24 17:50:07 +00:00