Commit Graph

54 Commits

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