aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor HasManyThroughAssociation to inherit from HasManyAssociation. ↵Pratik Naik2008-04-066-87/+67
| | | | | | Association callbacks and <association>_ids= now work with hm:t. Closes #11516 [rubyruy] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure HABTM#create and HABTM#build do not load entire association. [Pratik]Pratik Naik2008-04-053-21/+19
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9229 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Improve documentation.Pratik Naik2008-04-057-18/+73
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9226 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Replaced callback method evaluation in AssociationCollection class to use ↵Josh Peek2008-04-041-13/+2
| | | | | | ActiveSupport::Callbacks. Modified ActiveSupport::Callbacks::Callback#call to accept multiple arguments. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9225 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make HABTM#create behave the same as << with after_add callbacks. Closes ↵Michael Koziarski2008-04-041-4/+3
| | | | | | #11374 [freels] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9224 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't double include DISTINCT when the user has already specified it. ↵Michael Koziarski2008-04-041-1/+4
| | | | | | Closes #11502 [kenneth.kalmer] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9223 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Tiny change to allow AR based creation of TIME columns in sqlite. Closes ↵Michael Koziarski2008-04-041-1/+1
| | | | | | #11465 [h-lame] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9222 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Tweak ActiveRecord::Base#to_json to include a root value in the returned ↵Rick Olson2008-04-011-1/+16
| | | | | | hash: {post: {title: ...}} [rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9202 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add efficient #include? to AssociationCollection (for has_many/has_many ↵Rick Olson2008-04-012-1/+6
| | | | | | :through/habtm). [stopdropandrew] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9200 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Partial updates off by defaultJeremy Kemper2008-04-011-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9196 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: delete DEFAULTS key from Hash not Omap arrayJeremy Kemper2008-04-011-1/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9191 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* PostgreSQL: create_ and drop_database support. Closes #9042.Jeremy Kemper2008-04-011-0/+44
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9182 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure that validates_uniqueness_of works with with_scope. Closes #9235. ↵Pratik Naik2008-03-311-6/+8
| | | | | | [nik.wakelin, cavalle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9168 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix case-sensitive validates_uniqueness_of. Closes #11366 [miloops]Jeremy Kemper2008-03-311-19/+37
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9160 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Partial updates play nice with updated_at/on timestampsJeremy Kemper2008-03-312-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9159 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add :message option to validates_numericality_of. Closes #11456 [miloops, ↵Jeremy Kemper2008-03-311-1/+3
| | | | | | mdempfle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9158 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Partial updates include only unsaved attributes. Off by default; set ↵Jeremy Kemper2008-03-316-29/+52
| | | | | | YourClass.partial_updates = true to enable. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Dirty typecasts attribute values before comparison, if possible. Closes ↵Jeremy Kemper2008-03-291-1/+6
| | | | | | #11464 [Russell Norris, mroch] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9139 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that validates_size_of :within works in associations (closes #11295, ↵David Heinemeier Hansson2008-03-291-7/+5
| | | | | | #10019) [cavalle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9129 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Track changes to unsaved attributesJeremy Kemper2008-03-292-0/+119
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9127 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix new migration versionsDavid Heinemeier Hansson2008-03-281-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9126 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Switched to UTC-timebased version numbers for migrations and the schema. ↵David Heinemeier Hansson2008-03-283-66/+100
| | | | | | This will as good as eliminate the problem of multiple migrations getting the same version assigned in different branches. Also added rake db:migrate:up/down to apply individual migrations that may need to be run when you merge branches (closes #11458) [jbarnette] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9122 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that has_many :through would ignore the hash conditions (closes ↵David Heinemeier Hansson2008-03-281-2/+14
| | | | | | #11447) [miloops] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9110 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix issue where the :uniq option of a has_many :through association is ↵Rick Olson2008-03-261-5/+3
| | | | | | ignored when find(:all) is called. Closes #9407 [cavalle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9096 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix duplicate table alias error when including an association with a ↵Rick Olson2008-03-261-25/+27
| | | | | | has_many :through association on the same join table. Closes #7310 [cavalle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9095 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* More efficient association preloading code that compacts a through_records ↵Rick Olson2008-03-261-8/+11
| | | | | | array in a central location. Closes #11427 [danger] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9094 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Improve documentation.Pratik Naik2008-03-265-48/+82
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9093 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Typo fix in documentation from [9090] References #11422Michael Koziarski2008-03-261-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9092 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that ActiveRecord#Base.find_or_create/initialize would not honor ↵David Heinemeier Hansson2008-03-251-4/+12
| | | | | | attr_protected/accessible when used with a hash (closes #11422) [miloops] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9090 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added ActiveRecord#Base.all/first/last as aliases for ↵David Heinemeier Hansson2008-03-241-0/+12
| | | | | | find(:all/:first/:last) (closes #11413) [nkallen, thechrisoshow] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9085 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Merge the has_finder gem, renamed as 'named_scope'. Closes #11404 [nkallen]Rick Olson2008-03-247-6/+147
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix merging blank conditions. Closes #10764 [mcmire, cavalle]Jeremy Kemper2008-03-231-8/+21
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9082 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* has_one :through supports :source_type. Fix up some tests. References #4756.Jeremy Kemper2008-03-222-3/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9075 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow association scoping for built/created records if :conditions is ↵Rick Olson2008-03-212-3/+9
| | | | | | specified as a hash. Closes #11393 [miloops] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9068 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add has_one :through support, finally. Closes #4756 [thechrisoshow]Rick Olson2008-03-213-20/+98
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9067 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Docfixes (closes #11356, #11172, #10523)David Heinemeier Hansson2008-03-201-0/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9064 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Migrations: create_table supports primary_key_prefix_type. Closes #10314.Jeremy Kemper2008-03-182-4/+9
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9056 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactor filters to use Active Support callbacks. Closes #11235.Jeremy Kemper2008-03-181-8/+9
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9055 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Only log if theres a loggerDavid Heinemeier Hansson2008-03-171-1/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9051 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added logging for dependency load errors with fixtures (closes #11056) ↵David Heinemeier Hansson2008-03-171-5/+11
| | | | | | [stuthulhu] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9050 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Time, DateTime and TimeWithZone #in_time_zone defaults to Time.zone. ↵Geoff Buesing2008-03-171-2/+2
| | | | | | Removing now unneeded #in_current_time_zone. ActiveRecord time zone aware attributes updated to use #in_time_zone git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9047 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure that you can still do expressions in calculations (closes #11355) ↵David Heinemeier Hansson2008-03-171-1/+2
| | | | | | [nbugajski/cavelle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9043 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Docfix (closes #11309) [thechrisoshow]David Heinemeier Hansson2008-03-131-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9023 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that scoped joins would not always be respected (closes #6821) ↵David Heinemeier Hansson2008-03-131-7/+8
| | | | | | [Theory/Danger] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9022 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure that ActiveRecord::Calculations disambiguates field names with the ↵Rick Olson2008-03-131-0/+1
| | | | | | table name. Closes #11027 [cavalle] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added add/remove_timestamps to the schema statements for adding the ↵David Heinemeier Hansson2008-03-131-0/+16
| | | | | | created_at/updated_at columns on existing tables (closes #11129) [jramirez] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9014 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added ActiveRecord::Base.find(:last) (closes #11338) [miloops]David Heinemeier Hansson2008-03-121-1/+38
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9012 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add warning in documentation for increment!, decrement! and toggle! methods. ↵Pratik Naik2008-03-111-0/+3
| | | | | | Closes #11098 [DefV] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9011 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add :readonly option to HasManyThrough associations. Closes #11156 [miloops]Pratik Naik2008-03-071-1/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8989 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make the schema dumper respect the schema settings in database.yml. ↵Michael Koziarski2008-03-031-3/+5
| | | | | | References #8659 [sveiss] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8979 5ecf4fe2-1ee6-0310-87b1-e25e094e27de