Commit Graph

15129 Commits

Author SHA1 Message Date
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
David Heinemeier Hansson
612bb73fec Fixed a YAML fixture on time coming out as an integer #415 [Dan Peterson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@322 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 23:31:13 +00:00
David Heinemeier Hansson
609ca177fa Added HasManyAssociation#count that works like Base#count #413 [intinig]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@318 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 18:44:55 +00:00
David Heinemeier Hansson
569f2ea85b Added the possibility of specifying the remaining options for find_first and find_all with the new find_by/all_by* dynamic finders [danp]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@316 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 18:28:18 +00:00
David Heinemeier Hansson
3c141e12fc DB2 driver shouldnt be looking for RubyGems stuff
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@314 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 15:53:00 +00:00
David Heinemeier Hansson
51a13a7530 Brought install.rb up to date #408 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@313 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 15:38:49 +00:00
David Heinemeier Hansson
a18b3bf5c0 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@312 5ecf4fe2-1ee6-0310-87b1-e25e094e27de 2005-01-02 15:37:09 +00:00
David Heinemeier Hansson
089ef42520 Fixed handling of binary content in blobs and similar fields for Ruby/MySQL and SQLite #409 [xal]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@309 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 15:09:03 +00:00
David Heinemeier Hansson
959f362ac4 Added find_all style to the new dynamic finders
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@308 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 13:51:00 +00:00
David Heinemeier Hansson
ac8fd7dfb9 Added dynamic attribute-based finders as a cleaner way of getting objects by simple queries without turning to SQL.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@307 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 13:31:00 +00:00
David Heinemeier Hansson
93221685f1 Restored bind arity checking #412 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@306 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 12:45:53 +00:00
David Heinemeier Hansson
6bd672eb0d Added that Base#find takes an optional options hash, including :conditions. Base#find_on_conditions deprecated in favor of #find with :conditions #407 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@305 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 19:50:23 +00:00
David Heinemeier Hansson
86df396491 Added the latest two tables to the DB2 schemas
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@304 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 19:32:09 +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
a6fefad354 Added the final touches to the Microsoft SQL Server adapter by DeLynn Berry that makes it suitable for actual use #394 [DeLynn Barry]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@302 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 18:55:04 +00:00
David Heinemeier Hansson
3e0077f54d Fixed a bug in the Ruby/MySQL that caused binary content to be escaped badly and come back mangled #405 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 18:34:39 +00:00
David Heinemeier Hansson
cab2494563 Updated documentation for associations #387 [canadaduane]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@299 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 16:46:24 +00:00
David Heinemeier Hansson
7ad83b8df2 Added block-style for callbacks #332 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@296 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 16:14:15 +00:00
David Heinemeier Hansson
fbf9281f0e Added automated optimistic locking if the field lock_version is present #384 [Michael Koziarski]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@295 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-31 19:38:04 +00:00
David Heinemeier Hansson
9a5321fccf Added tests for acts_as_list with scope is null #378 [Tim Bates]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@292 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-31 16:58:50 +00:00
David Heinemeier Hansson
f0a3397c47 Added :counter_cache option to acts_as_tree that works just like the one you can define on belongs_to #371 [Josh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@291 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-31 16:53:41 +00:00
David Heinemeier Hansson
256d387159 Fixed quoting in validates_format_of that would allow some rules to pass regardless of input #390 [Dmitry V. Sabanin]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@288 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-31 16:42:25 +00:00
David Heinemeier Hansson
13273f7a55 Fixed broken transactions that were actually only running object-level and not db level transactions [andreas]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@286 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-30 14:52:42 +00:00
David Heinemeier Hansson
50562c2a7e Restored thread safety to Active Record [andreas]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@285 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-30 14:51:04 +00:00
David Heinemeier Hansson
3be52ef47c Transactions are now actually working on the database level on save, but thread safety is currently out the window. Andreas is working on it
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@284 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-30 14:29:44 +00:00
David Heinemeier Hansson
fa1f5e062e Switch dispatcher to use the new shared Dependencies approach
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@280 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-29 21:26:20 +00:00
David Heinemeier Hansson
595a4a591b Rearranging dependencies
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@279 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-29 21:19:37 +00:00
David Heinemeier Hansson
4290267959 Moved support into Active Support
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@277 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-29 21:14:58 +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
8a9b998b79 Fixed that the const_missing autoload assumes the requested constant is set by require_association and calls const_get to retrieve it. If require_association did not set the constant then const_get will call const_missing, resulting in an infinite loop #380 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@270 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-28 16:27:08 +00:00
David Heinemeier Hansson
4cd9c9561a Added the possibility for adapters to overwrite add_limit! to implement a different limiting scheme than "LIMIT X" used by MySQL, PostgreSQL, and SQLite.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@269 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-28 16:26:06 +00:00
David Heinemeier Hansson
d9c0a37f37 Releasing Rails 0.9.2
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@260 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 23:56:17 +00:00
David Heinemeier Hansson
ab4c640b96 Added scope option to validation_uniqueness #349 [Kent Sibilev]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@259 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 23:40:44 +00:00
David Heinemeier Hansson
d834b65b54 Added allow_nil options to validates_inclusion_of so that validation is only triggered if the attribute is not nil [what-a-day]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@258 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 23:25:45 +00:00
David Heinemeier Hansson
2ec81dcd28 Added work-around for PostgreSQL and the problem of getting fixtures to be created from id 1 on each test case. This only works for auto-incrementing primary keys called "id" for now #359 [Scott Baron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@257 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 23:09:30 +00:00
David Heinemeier Hansson
edbeec91ba Fixed mixin test and fixtures to work with postgresql #353 [Scott Baron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@253 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 14:14:45 +00:00
David Heinemeier Hansson
4b229d1034 Added Base#clear_association_cache to empty all the cached associations #347 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@252 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 13:54:44 +00:00
David Heinemeier Hansson
f408fcd610 Added more informative exceptions in establish_connection #356 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@249 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 13:39:19 +00:00
David Heinemeier Hansson
dbe8a26d7d Fixed that options[:counter_sql] was overwritten with interpolated sql rather than original sql #355 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@248 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 13:35:42 +00:00
David Heinemeier Hansson
91eaeb2803 Fixed that overriding an attribute's accessor would be disregarded by add_on_empty and add_on_boundary_breaking because they simply used the attributes[] hash instead of checking for @base.respond_to?(attr.to_s). [Marten]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@247 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 13:27:20 +00:00
David Heinemeier Hansson
dcc486805e Fixed that Base.table_name would expect a parameter when used in has_and_belongs_to_many joins [Anna Lissa Cruz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@244 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 13:00:15 +00:00
David Heinemeier Hansson
44819b4717 Fixed that nested transactions now work by letting the outer most transaction have the responsibilty of starting and rolling back the transaction. If any of the inner transactions swallow the exception raised, though, the transaction will not be rolled back. So always let the transaction bubble up even when you've dealt with local issues. Closes #231 and #340.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@242 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 00:48:24 +00:00
David Heinemeier Hansson
58f2bd0cfc Fixed validates_{confirmation,acceptance}_of to only happen when the virtual attributes are not nil #348 [dpiddy@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@241 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-21 23:41:07 +00:00
David Heinemeier Hansson
913f229e21 Added acts instead of mixins
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@240 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-21 13:58:04 +00:00
David Heinemeier Hansson
6ea54a630a Deal with associated classes that doesnt reside in their own files
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@237 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-20 21:48:38 +00:00
David Heinemeier Hansson
2e3106b617 Checked in the proper version of const_missing
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@236 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-20 16:57:56 +00:00
David Heinemeier Hansson
5df6128bfd Forgot a "or" in Inflector
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@235 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-20 16:55:26 +00:00
David Heinemeier Hansson
3e5a880987 Switched strategy on the id_before_type_cast problem and just did an explicit method so postgresql wouldnt choke on id is null
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@234 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-20 13:32:09 +00:00
David Heinemeier Hansson
8537d5eb93 Added a require_association hook on const_missing that makes it possible to use any model class without requiring it first. Added that Active Record associations are now reloaded instead of cleared to work with the new const_missing hook in Active Record.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@233 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-20 13:21:01 +00:00
David Heinemeier Hansson
ef489ca2ad Pulling attributes_from_column_definition should set the primary id to nil instead of not at all
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@232 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 23:11:06 +00:00
David Heinemeier Hansson
2f26785425 Scrap that
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@231 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 22:49:56 +00:00
David Heinemeier Hansson
c489b87d9d Dont define respond_to? lookups for primary key
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 22:40:09 +00:00
David Heinemeier Hansson
dad37cfafa FormHelper should only use *_before_type_cast if they available on the model
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@229 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 16:39:56 +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
88192b9b1b Added that query benchmarking will only happen if its going to be logged anyway #344
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@227 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 14:24:16 +00:00
David Heinemeier Hansson
830c561e71 Reworded a few doc things for better comprehension [dblack]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@226 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 14:17:28 +00:00
David Heinemeier Hansson
0f478181e4 Fixed small doc bug [dblack]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@225 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 13:59:23 +00:00
David Heinemeier Hansson
356f16006b Added higher_item and lower_item as public methods for acts_as_list #342 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@221 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 13:01:47 +00:00
David Heinemeier Hansson
01f05551c0 Added breakpoints to stand-alone Active Record, so we can use them in tests for AR
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@218 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 11:49:08 +00:00
David Heinemeier Hansson
a2130c22d7 Set a high default salary within the validation range
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@217 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 11:44:59 +00:00
David Heinemeier Hansson
87b0d72fe6 Added Developer#salary for the type tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@216 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 11:41:34 +00:00
David Heinemeier Hansson
7b5ed66122 Added respondence to *_before_type_cast for all attributes to return their string-state before they were type casted by the column type. Added use of *_before_type_cast for all input and text fields.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@215 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 11:25:55 +00:00
David Heinemeier Hansson
b09829354f Fixed the automated timestamping feature when running under Rails' development environment that resets the inheritable attributes on each request.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@212 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-18 15:15:27 +00:00
David Heinemeier Hansson
d678997688 Base#update_attribute isnt subject to validation
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-18 11:17:22 +00:00
David Heinemeier Hansson
3bef4c246a Made Base#update_attributes actually work
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@209 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-18 01:27:57 +00:00
David Heinemeier Hansson
604a09462e Added Base#update_attributes that'll accept a hash of attributes and save the record (returning true if it passed validation, false otherwise). Added a return value for Base#update_attribute, so that you get to know whether the save was successful or if it failed validation.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@207 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-17 21:51:14 +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
4e78b0627c Rails 0.9 is a reality
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@198 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 19:54:04 +00:00
David Heinemeier Hansson
2f3db152ec Made the last tweaks before 0.9
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@197 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 19:43:27 +00:00
David Heinemeier Hansson
f389a8fb5d Updated and added more documentation
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@193 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 17:14:41 +00:00
David Heinemeier Hansson
d2b75a083a Added Base.validates_inclusion_of
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@192 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 17:00:22 +00:00
David Heinemeier Hansson
f033833fb9 Improving documentation...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@191 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 16:56:30 +00:00
David Heinemeier Hansson
6860db61f5 Renamed Mixins to Acts to resemble the change from include ActiveRecord::Mixins::List to acts_as_list and renamed @@default_error_messagess to @@default_error_messages
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@190 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 16:23:59 +00:00
David Heinemeier Hansson
c5d6aa2b18 Added option for turning off the automated timestamps
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@184 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 15:21:16 +00:00
David Heinemeier Hansson
87297f1c4b Added assumption that a Symbol-based scope should end in _id unless it does so already and that you can pass vanilla string-based scopes as a parameter
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@183 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 13:42:21 +00:00
David Heinemeier Hansson
4d6bfc7a36 Added assumption that a Symbol-based scope should end in _id unless it does so already and that you can pass vanilla string-based scopes as a parameter
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@182 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 13:37:06 +00:00
David Heinemeier Hansson
2dbff3fbc0 Make it possible to use a regular scope string in addition to the symbol shortcut
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@181 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 13:22:57 +00:00
David Heinemeier Hansson
f296e117c6 Added Base.validates_inclusion_of that validates whether the value of the specified attribute is available in a particular enumerable object. [what-a-day]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@179 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 03:23:06 +00:00
David Heinemeier Hansson
f7f1fee765 Added Base.validates_inclusion_of that validates whether the value of the specified attribute is available in a particular enumerable object. [what-a-day]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 03:17:43 +00:00
David Heinemeier Hansson
d8a58eea11 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@177 5ecf4fe2-1ee6-0310-87b1-e25e094e27de 2004-12-16 03:01:11 +00:00
David Heinemeier Hansson
1f916a119c Added that Active Records will automatically record creation and/or update timestamps of database objects if fields of the names created_at/created_on or updated_at/updated_on are present. [Tobias Luetke] Added acts_as_tree that can decorates an existing class with a many to many relationship with itself. Added acts_as_list that can decorates an existing class with methods like move_higher/lower, move_to_top/bottom.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@176 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 02:49:18 +00:00
David Heinemeier Hansson
1579f3b45d Added Base.validates_format_of that Validates whether the value of the specified attribute is of the correct form by matching it against the regular expression provided. [Marcel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@174 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 01:32:35 +00:00
David Heinemeier Hansson
01e9b7c305 Added Base.default_error_messages as a hash of all the error messages used in the validates_*_of so they can be changed in one place [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@173 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-15 22:20:22 +00:00
David Heinemeier Hansson
7500a54692 Added automatic transaction block around AssociationCollection.<<, AssociationCollection.delete, and AssociationCollection.destroy_all
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@171 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-15 15:09:44 +00:00
David Heinemeier Hansson
846a1236bc Added Base.validates_boundries_of that delegates to add_on_boundary_breaking #312 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@166 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-15 12:29:08 +00:00
David Heinemeier Hansson
57ed93ee66 Fixed that Base#find will return an array if given an array -- regardless of the number of elements #270 [Marten]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@164 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-15 11:55:43 +00:00
David Heinemeier Hansson
d96e874e0f Insignificante...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@162 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-15 11:41:52 +00:00
David Heinemeier Hansson
0bb824b715 Changed validate_* to validates_*_of, so validate_acceptance becomes validates_acceptance_of, and added :on as a configuration option instead of using _on_create/update
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-15 01:36:05 +00:00
David Heinemeier Hansson
95314be65b Added tree mixin and unit tests for all the mixins
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-15 00:46:26 +00:00
David Heinemeier Hansson
0a8f382b80 Wrapped multi-step operations in transactions
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@155 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-14 18:17:44 +00:00
David Heinemeier Hansson
bc1aa7d9fd fixtures :models will now also attempt to include the model.rb file
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@153 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-14 18:01:28 +00:00
David Heinemeier Hansson
68d1056587 Fixed that has_and_belongs_to_many would generate bad sql when naming conventions differed from using vanilla "id" everywhere [RedTerror]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@152 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-14 13:55:17 +00:00
David Heinemeier Hansson
605bc77533 Added a better exception for when a type column is used in a table without the intention of triggering single-table inheritance. Added that single-table inheritance will only kick in if the inheritance_column (by default "type") is present. Otherwise, inheritance wont have any magic side effects
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-14 12:32:29 +00:00
David Heinemeier Hansson
317f13c2a8 Cut dependency on dev-utils by using included breakpoint lib
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@148 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-13 23:47:27 +00:00
David Heinemeier Hansson
2c5a2e7f2e Extended no inclusion of messages if theyre nil to base
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@144 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-13 19:25:33 +00:00
David Heinemeier Hansson
9b45e09b2a Fixed bug with reloading associations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@143 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-13 19:14:53 +00:00
David Heinemeier Hansson
81e3d06577 Moved methods into the main body as only wiring is needed in append_features
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@140 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-13 09:00:44 +00:00
David Heinemeier Hansson
df9276e8b9 Fixed that every successive call on the sqlite adapter prepended RAILS_ROOT again and again because RAILS_ROOT itself is the Windows absolute path which begins with the drive letter #294
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@139 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-12 22:19:48 +00:00
David Heinemeier Hansson
65a9011ea3 Fixed a pattern for module loading
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@137 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-12 20:37:43 +00:00
David Heinemeier Hansson
c9cc73d0e9 Added the possibility of marking fields as being in error without adding a message (using nil) to it thatll get displayed wth full_messages #208 [mjobin]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@135 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-12 19:46:16 +00:00
David Heinemeier Hansson
5c50df27cf Attempted to capture #286 in a unit test, but couldnt get it to fail
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@132 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-12 18:12:57 +00:00
David Heinemeier Hansson
1314f48d68 Added methods for resetting the cached information on classes that you want to clear between requests in development mode
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@130 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-12 17:49:38 +00:00
David Heinemeier Hansson
1da6abaa3c No longer necessary to guard against reincludes with the new reset of inheritance variables
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@127 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-12 16:51:02 +00:00
David Heinemeier Hansson
8e1f1ee442 Moved require_association to associations.rb and added methods for resetting the inheritable attributes on subclasses
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@125 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-12 16:14:20 +00:00
David Heinemeier Hansson
0c72e6d665 Options for the new validation methods are now given as a hash
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@109 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-10 16:46:41 +00:00
David Heinemeier Hansson
aaf9a45ca9 Added Base.validate_uniqueness thatv alidates whether the value of the specified attributes are unique across the system. Useful for making sure that only one user can be named "davidhh".
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@108 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-10 16:02:11 +00:00
David Heinemeier Hansson
0b92b7de2f Added Base.validate_presence as an alternative to implementing validate and doing errors.add_on_empty yourself. Added _on_create and _on_update versions for all the new validations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@107 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-10 13:11:13 +00:00
David Heinemeier Hansson
c7589559de Tidied up Fixtures for better readability and some error checking [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@100 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-09 15:52:54 +00:00
David Heinemeier Hansson
8bf9ec6171 Fixed TIMESTAMP columns broken due to TIME handling patch
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@99 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-09 15:49:37 +00:00
David Heinemeier Hansson
5b983f6f6b Fixed Base.errors to be indifferent as to whether strings or symbols are used.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@98 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-09 15:06:24 +00:00
David Heinemeier Hansson
27ea0b527e Added Base.validate_confirmation that encapsulates the pattern of wanting to validate the acceptance of a terms of service check box (or similar agreement)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@97 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-09 14:37:37 +00:00
David Heinemeier Hansson
d33f814db5 Changed the Proc for a string to avoid repetition problems
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@96 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-09 14:04:58 +00:00
David Heinemeier Hansson
a65f791fbd Added Base.validate_confirmation that encapsulates the pattern of wanting to validate a password or email address field with a confirmation.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@95 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-09 13:37:11 +00:00
David Heinemeier Hansson
fc817eff44 Added validation macros to make the stackable just like the lifecycle callbacks
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@94 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-09 12:50:18 +00:00
David Heinemeier Hansson
cf6282099d A fix that actually works...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@91 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-08 17:44:31 +00:00
David Heinemeier Hansson
ac4a039a31 Callbacks added to the inheritable que should only be called once -- even as the definition is read again
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@90 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-08 17:39:44 +00:00
David Heinemeier Hansson
04d032ed43 scope_condition defaults to 1 on list mixin
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@89 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-08 17:25:06 +00:00
David Heinemeier Hansson
14b4040a30 Added mixins to install.rb
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@88 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-08 16:23:11 +00:00
David Heinemeier Hansson
3fef016493 Cleaned up the class_eval stuff in the new mixins a bit
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@87 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-08 16:20:51 +00:00
David Heinemeier Hansson
fdd28592f6 Forgot to include Mixins::Touch by default
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@86 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-08 16:14:26 +00:00
David Heinemeier Hansson
7359bccece Added ActiveRecord::Mixins::Touch that will record creation and update times of objects [xal]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@85 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-08 16:13:04 +00:00
David Heinemeier Hansson
1cf7eb1ca8 Added ActiveRecord::Mixins::List that can decorates an existing class with methods like move_higher/lower, move_to_top/bottom
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@84 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-08 16:02:18 +00:00
David Heinemeier Hansson
55be0a3cb5 Renamed from ListMixin and mixins/list_mixin.rb to Mixins::List and mixin/list.rb
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@83 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-08 15:53:57 +00:00
David Heinemeier Hansson
2d483af0d7 Unofficially added ListMixin
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@82 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-08 15:39:22 +00:00
David Heinemeier Hansson
554597d657 Added named bind-style variable interpolation #281 [Michael Koziarski]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@78 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-08 10:38:10 +00:00
David Heinemeier Hansson
a775cb1903 Added the option for sanitizing find_by_sql and the offset parts in regular finds [Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@75 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-07 21:14:20 +00:00
David Heinemeier Hansson
49403831fc Fixed value quoting in all generated SQL statements, so that integers are not surrounded in quotes and that all sanitation are happening through the database's own quoting routine. This should hopefully make it lots easier for new adapters that doesn't accept '1' for integer columns.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@70 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-07 14:48:53 +00:00
David Heinemeier Hansson
8a40c6b522 Fixed has_and_belongs_to_many guessing of foreign key so that keys are generated correctly for models like SomeVerySpecialClient [Florian Weber]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@69 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-07 12:33:42 +00:00
David Heinemeier Hansson
ea759cb761 Added counter_sql option for has_many associations [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@68 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-07 12:25:01 +00:00
David Heinemeier Hansson
8e4edec877 Fixed that methods wrapped in callbacks still return their original result #260 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@65 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-07 12:10:57 +00:00
David Heinemeier Hansson
b4f4d038b9 Fixed the Inflector to handle the movie/movies pair correctly #261 [Scott Baron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@60 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-07 11:15:41 +00:00
David Heinemeier Hansson
d1856a00a3 Documentation bugs
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@59 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-07 11:12:05 +00:00
David Heinemeier Hansson
3e7d191e64 Added bind-style variable interpolation for the condition arrays that uses the adapter's quote method [Michael Koziarski]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@56 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-07 10:37:50 +00:00
David Heinemeier Hansson
5e3eaff5bb Added CSV format for fixtures #272 [what-a-day]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@55 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-07 10:24:13 +00:00
David Heinemeier Hansson
35c89c4176 Fixed fixtures using primary key fields called something else than "id" #270 [dave]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@53 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-06 18:56:49 +00:00
David Heinemeier Hansson
2575b3b065 Added extra words of caution for guarding against SQL-injection attacks
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@46 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-06 18:08:35 +00:00
David Heinemeier Hansson
9a248a83b5 Dont include the primary key in updates -- its unneeded and SQL Server chokes on it
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@42 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-01 15:20:53 +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
79e85edd71 Added reverse order of deleting fixtures, so referential keys can be maintained #247 [Tim Bates]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@38 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-01 12:25:04 +00:00
David Heinemeier Hansson
eec4638eb6 Fixed infinite loop when environment is missing in database.yml
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@35 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-01 11:28:52 +00:00
David Heinemeier Hansson
bc80460115 Added relative path search for sqlite dbfiles in database.yml (if RAILS_ROOT is defined) #233 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@34 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-01 11:26:47 +00:00
David Heinemeier Hansson
d6d875bfb4 Moved the global require_* out of the classes so they actually work without stack overflows
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@33 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-11-30 19:13:34 +00:00
David Heinemeier Hansson
d82f73ecab Abolished ActionController::Base.require_or_load in favor of require_dependency and ActiveRecord::Base.require_or_load in favor of require_association. Both methods are now also available in the global namespace when you need to require dependencies or associations outside of whats done automatically.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@32 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-11-30 18:52:20 +00:00
David Heinemeier Hansson
ac3c8a54f8 Silence errors occurring when reloading classes
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@27 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-11-30 16:25:08 +00:00
David Heinemeier Hansson
e15b371777 symbolize_strings_in_hash shouldnt change receiver -- this should fix the bug with dump_schema in the rakefile
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@17 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-11-26 00:50:49 +00:00
David Heinemeier Hansson
7022dd9c05 Keep quiet about failing to load association classes. People know what theyre doing.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@16 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-11-26 00:19:47 +00:00
David Heinemeier Hansson
43704662ef Dont include svn directories in packages
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@11 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-11-25 16:31:27 +00:00
David Heinemeier Hansson
064877cab8 Added option to establish_connection where you'll be able to leave out the parameter to have it use the RAILS_ENV environment variable
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-11-25 16:03:33 +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