Commit Graph

17 Commits

Author SHA1 Message Date
David Heinemeier Hansson 76242253ad Updated documentation for serialize
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@513 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-25 20:00: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 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 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 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 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 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 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 daf3e92a31 Added a db2 adapter that only depends on the Ruby/DB2 bindings (http://raa.ruby-lang.org/project/ruby-db2/) #386 [Maik Schmidt]. Converted all the fixtures to YAML style ones.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@303 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 19:22:16 +00:00
David Heinemeier Hansson 60de8c1108 Added Base.default_timezone accessor that determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates and times from the database. This is set to :local by default.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@271 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-28 17:30:17 +00:00
David Heinemeier Hansson 69cb942d9b Changed the interface on AbstractAdapter to require that adapters return the number of affected rows on delete and update operations. Added that Base.update_all and Base.delete_all return an integer of the number of affected rows #341
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@228 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 16:21:55 +00:00
David Heinemeier Hansson 648b8fda54 Added Base.destroy and Base.delete to remove records without holding a reference to them first.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@206 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-17 21:36:13 +00:00
David Heinemeier Hansson 0daa29ece2 Added proper handling of time fields that are turned into Time objects with the dummy date of 2000/1/1 [HariSeldon]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@40 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-01 13:18:51 +00:00
David Heinemeier Hansson db045dbbf6 Initial
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-11-24 01:04:44 +00:00