David Heinemeier Hansson
a3298e5efd
Small indent
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@613 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-15 00:03:18 +00:00
David Heinemeier Hansson
1aa82b3217
Added keyword-style approach to defining the custom relational bindings #545 [Jamis Buck]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@527 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-07 14:26:57 +00:00
David Heinemeier Hansson
098fa94356
Fixed documentation snafus #575 , #576 , #577 , #585
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@525 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-07 14:15:53 +00:00
David Heinemeier Hansson
9b0fd9d00d
Added that the 'fixture :posts' syntax can be used for has_and_belongs_to_many fixtures where a model doesn't exist #572 [bitsweat]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@524 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-07 14:10:44 +00:00
David Heinemeier Hansson
336c2cbb8f
Added an Oracle adapter that works with the Oracle bindings by Yoshida ( http://raa.ruby-lang.org/project/oracle/ ) #564 [Maik Schmidt]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@522 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-07 14:06:00 +00:00
David Heinemeier Hansson
431e21cb45
Fixed Base#clone for use with PostgreSQL #565 [hanson@surgery.wisc.edu]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@519 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-07 13:43:44 +00:00
David Heinemeier Hansson
66f44e6cbb
Updated documentation for serialize
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@512 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-25 20:00:20 +00:00
David Heinemeier Hansson
efa81dad51
Added the option of supplying an array of ids and attributes to Base#update, so that multiple records can be updated at once (inspired by #526/Duane Johnson). Added the option of supplying an array of attributes to Base#create, so that multiple records can be created at once. Added that Base#delete and Base#destroy both can take an array of ids to delete/destroy #336 . Added that has_many association build and create methods can take arrays of record data like Base#create and Base#build to build/create multiple records at once.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-25 12:45:01 +00:00
David Heinemeier Hansson
256b594a03
Fixed documentation #538
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@503 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-25 11:20:42 +00:00
David Heinemeier Hansson
fd67e3befc
The create and build methods are only available for has_one/belongs_to if an association already exist. It will not work when it's nil. Updated the documentation to reflect that.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@501 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-25 10:04:49 +00:00
David Heinemeier Hansson
0d2db8a7d1
Added Base.update_collection that can update an array of id/attribute pairs, such as the ones produced by the recent added support for automatic id-based indexing for lists of items #526 [Duane Johnson]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@496 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 14:13:10 +00:00
David Heinemeier Hansson
981d86cbb9
Added ActiveRecord::Base.timestamps_gmt that can be set to true to make the automated timestamping use GMT instead of local time #520 [Scott Baron]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@491 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 13:18:29 +00:00
David Heinemeier Hansson
566a36966b
Added that update_all calls sanitize_sql on its updates argument, so stuff like MyRecord.update_all(['time = ?', Time.now]) works #519 [notahat]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@489 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 13:06:12 +00:00
David Heinemeier Hansson
93ec130377
Fixed that the dynamic finders didnt treat nil as a "IS NULL" but rather "= NULL" case #515 [Demetrius]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@488 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 13:02:50 +00:00
David Heinemeier Hansson
872ddaf290
Added bind-named arrays for interpolating a group of ids or strings in conditions #528 [bitsweat]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@485 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 11:57:22 +00:00
David Heinemeier Hansson
b29c01ea89
Added that has_and_belongs_to_many associations with additional attributes also can be created between unsaved objects and only committed to the database when Base#save is called on the associator #524 [Eric Anderson]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@484 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 11:39:23 +00:00
David Heinemeier Hansson
1d61845587
Fixed that records fetched with piggy-back attributes or through rich has_and_belongs_to_many associations couldn't be saved due to the extra attributes not part of the table #522 [Eric Anderson]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@483 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-24 11:20:47 +00:00
David Heinemeier Hansson
95454bfb33
Added mass-assignment protection for the inheritance column -- regardless of a custom column is used or not
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-23 17:24:54 +00:00
David Heinemeier Hansson
97849debf3
Fixed that association proxies would fail === tests like PremiumSubscription === @account.subscription
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@476 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-23 15:19:33 +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
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
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
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
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
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
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
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
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