aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
Commit message (Collapse)AuthorAgeFilesLines
* Added option for turning off the automated timestampsDavid Heinemeier Hansson2004-12-161-5/+14
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@184 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added assumption that a Symbol-based scope should end in _id unless it does ↵David Heinemeier Hansson2004-12-161-5/+3
| | | | | | 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
* Make it possible to use a regular scope string in addition to the symbol ↵David Heinemeier Hansson2004-12-161-1/+5
| | | | | | shortcut git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@181 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base.validates_inclusion_of that validates whether the value of the ↵David Heinemeier Hansson2004-12-161-0/+23
| | | | | | 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
* git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@177 ↵David Heinemeier Hansson2004-12-161-0/+22
| | | | 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added that Active Records will automatically record creation and/or update ↵David Heinemeier Hansson2004-12-164-147/+135
| | | | | | 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
* Added Base.validates_format_of that Validates whether the value of the ↵David Heinemeier Hansson2004-12-161-6/+28
| | | | | | 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
* Added Base.default_error_messages as a hash of all the error messages used ↵David Heinemeier Hansson2004-12-151-9/+22
| | | | | | 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
* Added automatic transaction block around AssociationCollection.<<, ↵David Heinemeier Hansson2004-12-151-8/+17
| | | | | | AssociationCollection.delete, and AssociationCollection.destroy_all git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@171 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base.validates_boundries_of that delegates to add_on_boundary_breaking ↵David Heinemeier Hansson2004-12-151-18/+37
| | | | | | #312 [Tobias Luetke] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@166 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that Base#find will return an array if given an array -- regardless of ↵David Heinemeier Hansson2004-12-151-1/+3
| | | | | | the number of elements #270 [Marten] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@164 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Insignificante...David Heinemeier Hansson2004-12-151-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@162 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Changed validate_* to validates_*_of, so validate_acceptance becomes ↵David Heinemeier Hansson2004-12-151-56/+27
| | | | | | 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
* Added tree mixin and unit tests for all the mixinsDavid Heinemeier Hansson2004-12-153-15/+60
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Wrapped multi-step operations in transactionsDavid Heinemeier Hansson2004-12-141-16/+22
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@155 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* fixtures :models will now also attempt to include the model.rb fileDavid Heinemeier Hansson2004-12-141-0/+11
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@153 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that has_and_belongs_to_many would generate bad sql when naming ↵David Heinemeier Hansson2004-12-141-4/+4
| | | | | | conventions differed from using vanilla "id" everywhere [RedTerror] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@152 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added a better exception for when a type column is used in a table without ↵David Heinemeier Hansson2004-12-142-3/+20
| | | | | | 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
* Extended no inclusion of messages if theyre nil to baseDavid Heinemeier Hansson2004-12-131-1/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@144 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed bug with reloading associationsDavid Heinemeier Hansson2004-12-131-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@143 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Moved methods into the main body as only wiring is needed in append_featuresDavid Heinemeier Hansson2004-12-131-9/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@140 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that every successive call on the sqlite adapter prepended RAILS_ROOT ↵David Heinemeier Hansson2004-12-121-1/+1
| | | | | | 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
* Added the possibility of marking fields as being in error without adding a ↵David Heinemeier Hansson2004-12-121-2/+2
| | | | | | 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
* Added methods for resetting the cached information on classes that you want ↵David Heinemeier Hansson2004-12-121-5/+10
| | | | | | to clear between requests in development mode git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@130 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* No longer necessary to guard against reincludes with the new reset of ↵David Heinemeier Hansson2004-12-122-2/+2
| | | | | | inheritance variables git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@127 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Moved require_association to associations.rb and added methods for resetting ↵David Heinemeier Hansson2004-12-123-31/+28
| | | | | | the inheritable attributes on subclasses git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@125 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Options for the new validation methods are now given as a hashDavid Heinemeier Hansson2004-12-102-11/+27
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@109 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base.validate_uniqueness thatv alidates whether the value of the ↵David Heinemeier Hansson2004-12-103-6/+30
| | | | | | 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
* Added Base.validate_presence as an alternative to implementing validate and ↵David Heinemeier Hansson2004-12-101-12/+53
| | | | | | 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
* Tidied up Fixtures for better readability and some error checking [bitsweat]David Heinemeier Hansson2004-12-091-36/+49
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@100 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed TIMESTAMP columns broken due to TIME handling patchDavid Heinemeier Hansson2004-12-091-11/+15
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@99 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed Base.errors to be indifferent as to whether strings or symbols are used.David Heinemeier Hansson2004-12-091-15/+20
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@98 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base.validate_confirmation that encapsulates the pattern of wanting to ↵David Heinemeier Hansson2004-12-091-0/+23
| | | | | | 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
* Changed the Proc for a string to avoid repetition problemsDavid Heinemeier Hansson2004-12-091-5/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@96 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base.validate_confirmation that encapsulates the pattern of wanting to ↵David Heinemeier Hansson2004-12-091-0/+31
| | | | | | 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
* Added validation macros to make the stackable just like the lifecycle callbacksDavid Heinemeier Hansson2004-12-091-1/+46
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@94 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* A fix that actually works...David Heinemeier Hansson2004-12-081-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@91 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Callbacks added to the inheritable que should only be called once -- even as ↵David Heinemeier Hansson2004-12-081-1/+1
| | | | | | the definition is read again git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@90 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* scope_condition defaults to 1 on list mixinDavid Heinemeier Hansson2004-12-081-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@89 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Cleaned up the class_eval stuff in the new mixins a bitDavid Heinemeier Hansson2004-12-082-9/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@87 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Forgot to include Mixins::Touch by defaultDavid Heinemeier Hansson2004-12-081-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@86 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added ActiveRecord::Mixins::Touch that will record creation and update times ↵David Heinemeier Hansson2004-12-081-0/+35
| | | | | | of objects [xal] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@85 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added ActiveRecord::Mixins::List that can decorates an existing class with ↵David Heinemeier Hansson2004-12-081-1/+4
| | | | | | 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
* Renamed from ListMixin and mixins/list_mixin.rb to Mixins::List and ↵David Heinemeier Hansson2004-12-083-154/+157
| | | | | | mixin/list.rb git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@83 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Unofficially added ListMixinDavid Heinemeier Hansson2004-12-081-0/+154
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@82 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added named bind-style variable interpolation #281 [Michael Koziarski]David Heinemeier Hansson2004-12-081-6/+35
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@78 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added the option for sanitizing find_by_sql and the offset parts in regular ↵David Heinemeier Hansson2004-12-071-4/+9
| | | | | | finds [Sam Stephenson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@75 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed value quoting in all generated SQL statements, so that integers are ↵David Heinemeier Hansson2004-12-078-49/+65
| | | | | | 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
* Fixed has_and_belongs_to_many guessing of foreign key so that keys are ↵David Heinemeier Hansson2004-12-071-1/+1
| | | | | | generated correctly for models like SomeVerySpecialClient [Florian Weber] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@69 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added counter_sql option for has_many associations [bitsweat]David Heinemeier Hansson2004-12-072-7/+15
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@68 5ecf4fe2-1ee6-0310-87b1-e25e094e27de