Commit Graph

198 Commits

Author SHA1 Message Date
David Heinemeier Hansson
dfed3d309e A few missing files
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@468 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-20 14:55:13 +00:00
David Heinemeier Hansson
b40d3c9e62 Replaced === checks with is_a? checks #502, #82 [Marcel Molina]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@466 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-20 14:40:11 +00:00
David Heinemeier Hansson
db6688585f Fixed that column aliases didn't work as expected with the new MySql411 driver #507 [Demetrius]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@465 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-20 14:36:39 +00:00
David Heinemeier Hansson
4ddbe0ac44 Fixed that find_all would produce invalid sql when called sequentialy #490 [Scott Baron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@464 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-20 14:35:00 +00:00
David Heinemeier Hansson
a5364fb3ac Made ready for release of 0.9.4.1
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@458 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-18 14:13:12 +00:00
David Heinemeier Hansson
3ebde40cec Cleanup the proxy rollback #492
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@457 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-18 14:06:49 +00:00
David Heinemeier Hansson
bce0e14930 Fixed that the belongs_to and has_one proxy would fail a test like 'if project.manager' -- this unfortunately also means that you can't call methods like project.manager.build unless there already is a manager on the project #492 [Tim Bates]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@456 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-18 11:07:03 +00:00
David Heinemeier Hansson
53088c4c7f Fixed that the Ruby/MySQL adapter wouldn't connect if the password was empty #503 [Pelle]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@454 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-18 09:54:12 +00:00
David Heinemeier Hansson
1f7e72ff51 Made human_attribute_name(attribute_key_name) use Inflector.humanize
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@451 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-17 19:58:02 +00:00
David Heinemeier Hansson
ddcc400293 Made ready for release of 0.9.4
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@439 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-17 01:13:15 +00:00
David Heinemeier Hansson
dd420ef303 Make sure #470 shouldnt be happening
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@437 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-17 01:01:21 +00:00
David Heinemeier Hansson
d598635988 Added test_forgetting_the_load_when_foreign_key_enters_late
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@436 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-17 00:44:55 +00:00
David Heinemeier Hansson
44ac6046c1 Only remember that an association was loaded if it was found
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@435 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-17 00:44:22 +00:00
David Heinemeier Hansson
8b82c5042d Test for #489
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-17 00:32:56 +00:00
David Heinemeier Hansson
1ae630a404 belongs_to association should always honor a present foreign key and condition interpolation should also be possible on belongs_to
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@433 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-17 00:30:53 +00:00
David Heinemeier Hansson
ee014ef95a New adventures in dependency reloading
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@429 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-16 17:50:36 +00:00
David Heinemeier Hansson
fb13b7a495 Removed the Ruby 1.8.2 test/unit fix as it didnt work anyway
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@423 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-15 20:55:19 +00:00
David Heinemeier Hansson
bb92382424 Fixed that unit tests for MySQL are now run as the "rails" user instead of root #455 [Eric Hodel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@419 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-15 17:54:45 +00:00
David Heinemeier Hansson
51390b8524 Added validates_associated that enables validation of objects in an unsaved association #398 [Tim Bates]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@418 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-15 17:52:08 +00:00
David Heinemeier Hansson
823554eafe Added support for associating unsaved objects #402 [Tim Bates]
Added replace to associations, so you can do project.manager.replace(new_manager) or project.milestones.replace(new_milestones) #402 [Tim Bates]
Added build and create methods to has_one and belongs_to associations, so you can now do project.manager.build(attributes) #402 [Tim Bates]
Fixed that Base#== wouldn't work for multiple references to the same unsaved object #402 [Tim Bates]
Added that if a before_* callback returns false, all the later callbacks and the associated action are cancelled. If an after_* callback returns false, all the later callbacks are cancelled. Callbacks are generally run in the order they are defined, with the exception of callbacks defined as methods on the model, which are called last. #402 [Tim Bates]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@417 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-15 17:45:16 +00:00
David Heinemeier Hansson
f73ecc8626 Added a bit more documentation on how to use the instance methods for acts_as_list #478
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@411 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-15 13:49:23 +00:00
David Heinemeier Hansson
ad63c96ff2 Fixed binary support for PostgreSQL #444 [alex@byzantine.no]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@410 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-15 13:48:39 +00:00
David Heinemeier Hansson
4a0695996f Removed silly change caused by inability to grok own code at 3 am
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@406 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-14 02:12:00 +00:00
David Heinemeier Hansson
023227d78d Changed add_to_list_top and add_to_list_bottom to be public
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@405 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-14 01:24:57 +00:00
David Heinemeier Hansson
4cee51e1cc Refactored ActiveRecord::Base#clone to use Base#attributes #463 [atyp]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@401 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-13 13:56:00 +00:00
David Heinemeier Hansson
8d5d7161eb Remove length alias of size
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@396 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-11 22:36:16 +00:00
David Heinemeier Hansson
fe8fb574c0 Added a differenciation between AssociationCollection#size and -length. Now AssociationCollection#size returns the size of the collection by executing a SELECT COUNT(*) query if the collection hasn't been loaded and calling collection.size if it has. If it's more likely than not that the collection does have a size larger than zero and you need to fetch that collection afterwards, it'll take one less SELECT query if you use length.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@392 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-11 13:21:17 +00:00
David Heinemeier Hansson
45ea2bd452 Fixed the 4.11 changes to the mysql adapter
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@391 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-11 10:59:49 +00:00
David Heinemeier Hansson
0f4cba7b86 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@388 5ecf4fe2-1ee6-0310-87b1-e25e094e27de 2005-01-11 00:53:04 +00:00
David Heinemeier Hansson
b067bf7884 Added Base#attributes that returns a hash of all the attributes with their names as keys and clones of their objects as values #433 [atyp.de]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@386 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-11 00:45:26 +00:00
David Heinemeier Hansson
79365a0184 Fixed that foreign keys named the same as the association would cause stack overflow #437 [Eric Anderson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@382 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-11 00:24:19 +00:00
David Heinemeier Hansson
a971dc5e4a Fixed default scope of acts_as_list from "1" to "1 = 1", so itll work in PostgreSQL (among other places) #427 [Alexey]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@380 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-11 00:13:42 +00:00
David Heinemeier Hansson
3ff5c5805f Added Base#reload that reloads the attributes of an object from the database #422 [Andreas Schwarz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@376 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-10 23:49:57 +00:00
David Heinemeier Hansson
a133f3e64f Added SQLite3 compatibility through the sqlite3-ruby adapter by Jamis Buck #381 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@374 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-10 23:09:51 +00:00
David Heinemeier Hansson
b9f28eb587 Added support for the new protocol spoken by MySQL 4.1.1+ servers for the Ruby/MySQL adapter that ships with Rails #440 [Matt Mower]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@372 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-10 22:52:14 +00:00
David Heinemeier Hansson
7ed4b745fc Some missing docs
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@369 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-10 19:18:37 +00:00
David Heinemeier Hansson
d5de666056 Added that Observers can use the observes class method instead of overwriting self.observed_class()
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@367 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-10 16:06:04 +00:00
David Heinemeier Hansson
38e55bac61 Added time unit extensions to Fixnum that'll return the period in seconds, like 2.days + 4.hours
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@365 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-10 13:14:50 +00:00
David Heinemeier Hansson
590ea2930d Added inclusion of fix for test/unit and rake problems with Ruby 1.8.2
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@361 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-10 00:33:03 +00:00
David Heinemeier Hansson
b64004fda6 Fixed that conditions in has_many and has_and_belongs_to_many should be interpolated just like the finder_sql is
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@344 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-07 03:55:24 +00:00
David Heinemeier Hansson
393e98a859 Fixed Base#update_attribute to be indifferent to whether a string or symbol is used to describe the name
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@341 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-06 02:36:33 +00:00
David Heinemeier Hansson
d1abe806c5 Added Base#toggle(attribute) and Base#toggle!(attribute) that makes it easier to flip a switch or flag. Added Base#increment!(attribute) and Base#decrement!(attribute) that also saves the records. Added Base#increment(attribute) and Base#decrement(attribute) that encapsulates the += 1 and -= 1 patterns.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@340 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-06 02:31:35 +00:00
David Heinemeier Hansson
f2e6945b25 Prepared for release of 0.9.3
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@333 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-04 12:35:10 +00:00
David Heinemeier Hansson
2afdf01e5c Minor tweak for readability
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@332 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-04 11:00:48 +00:00
David Heinemeier Hansson
6f711551d4 Fixed some thread safety issues with DB2
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@331 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-04 10:55:34 +00:00
David Heinemeier Hansson
d05fa50914 Fixed #406 for real
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-04 02:03:50 +00:00
David Heinemeier Hansson
f8bc7a4577 Fixed that validates_uniqueness_of used 'id' instead of defined primary key #406
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@328 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-04 01:23:38 +00:00
David Heinemeier Hansson
5ac11f2de3 Fixed that the overwritten respond_to? method didn't take two parameters like the original #391
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@327 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-03 23:24:31 +00:00
David Heinemeier Hansson
846f0d5ab6 Fixed that the overwritten respond_to? method didn't take two parameters like the original #391
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-03 23:23:02 +00:00
David Heinemeier Hansson
d9e900cd9d Fixed the last details to please DB2
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@324 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-03 23:00:44 +00:00