Commit Graph

126 Commits

Author SHA1 Message Date
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