aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
Commit message (Collapse)AuthorAgeFilesLines
* Partial updates include only unsaved attributes. Off by default; set ↵Jeremy Kemper2008-03-311-4/+4
| | | | | | YourClass.partial_updates = true to enable. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Switched to UTC-timebased version numbers for migrations and the schema. ↵David Heinemeier Hansson2008-03-281-1/+1
| | | | | | 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
* 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
* 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
* Migrations: create_table supports primary_key_prefix_type. Closes #10314.Jeremy Kemper2008-03-181-3/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9056 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
* 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
* Fix edge case with colons in times interpreted as bind variables by ↵Jeremy Kemper2008-02-271-1/+1
| | | | | | requiring that bind vars start with a letter. Closes #10519 [matrix9180] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8936 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Correct typo in before_type_cast code. Closes #11165 [amishyn]Michael Koziarski2008-02-191-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8898 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* ActiveRecord::Base#instantiate_time_object only uses Time.zone when ↵Geoff Buesing2008-02-161-2/+2
| | | | | | Base.time_zone_aware_attributes is true; leverages Time#time_with_datetime_fallback for readability git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8882 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Avoid repeated calls to Base#connection. Closes #11111 [adymo]Michael Koziarski2008-02-141-2/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8871 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove options from the attributes method, tidy up the implementation. ↵Michael Koziarski2008-02-131-22/+5
| | | | | | Closes #11093 [juanjo.bazan, Koz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8863 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Avoid cloning in Base#attributes_before_typecast. Closes #11077 [juanjo.bazan]Michael Koziarski2008-02-111-3/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8858 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Multiparameter attributes for time columns fail over to DateTime when out of ↵Geoff Buesing2008-02-101-2/+1
| | | | | | range of Time git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8855 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* TimeZone#new renamed #local, so that new TimeWithZone instances can be ↵Geoff Buesing2008-02-101-1/+1
| | | | | | created via Time.zone.local() git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8847 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Avoid cloning in Base#attributes. Closes #11047 [juanjo.bazan]Michael Koziarski2008-02-081-7/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8824 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add Time Zone support to ActiveRecord, and config.time_zone property for ↵Rick Olson2008-02-061-4/+8
| | | | | | specifying a default Time Zone. Closes #10982 [Geoff Buesing, rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8806 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* When multiparameter date assignment fails due to an invalid date, fall back ↵Jeremy Kemper2008-02-021-1/+17
| | | | | | to create a Time and convert to_date. Closes #10556 [leikind] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8777 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Avoid Base#attributes when saving / creating records. Closes #10978 [adymo]Michael Koziarski2008-02-011-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8770 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Introduce preload query strategy for eager :includes. Closes #9640.Jeremy Kemper2008-01-191-3/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8672 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Support aggregations in finder conditions. Closes #10572.Jeremy Kemper2008-01-191-0/+56
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8671 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* More thoroughly quote table names. Exposes some issues with sqlite2 adapter. ↵Jeremy Kemper2008-01-051-1/+1
| | | | | | Closes #10698. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* pdate_all ignores scoped :order and :limit, so post.comments.update_all ↵Jeremy Kemper2008-01-041-2/+2
| | | | | | doesn't try to include the comment order in the update statement. Closes #10686. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8554 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Moved the caching stores from ActionController::Caching::Fragments::* to ↵David Heinemeier Hansson2008-01-031-0/+16
| | | | | | ActiveSupport::Cache::*. If you're explicitly referring to a store, like ActionController::Caching::Fragments::MemoryStore, you need to update that reference with ActiveSupport::Cache::MemoryStore [DHH] Deprecated ActionController::Base.fragment_cache_store for ActionController::Base.cache_store [DHH] All fragment cache keys are now by default prefixed with the 'views/' namespace [DHH] Added ActiveRecord::Base.cache_key to make it easier to cache Active Records in combination with the new ActiveSupport::Cache::* libraries [DHH] Added ActiveSupport::Gzip.decompress/compress(source) as an easy wrapper for Zlib [Tobias Luetke] Included MemCache-Client to make the improved ActiveSupport::Cache::MemCacheStore work out of the box [Bob Cottrell, Eric Hodel] Added config.cache_store to environment options to control the default cache store (default is FileStore if tmp/cache is present, otherwise MemoryStore is used) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8546 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added by parameter to increment, decrement, and their bang varieties so you ↵David Heinemeier Hansson2008-01-031-10/+10
| | | | | | can do player1.increment!(:points, 5) (closes #10542) [Sam] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8534 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Optimize ActiveRecord::Base#exists? to use #select_all instead of #find. ↵Rick Olson2008-01-021-2/+8
| | | | | | Closes #10605 [jamesh, fcheung, protocool] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8531 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use extract_options! rather than Hash test + pop. Closes #10628 [ssoroka]Jeremy Kemper2007-12-281-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8496 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: don't modify iterator target within blockJeremy Kemper2007-12-271-3/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8487 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: fix warnings, shadowed block vars, and unitialized instance ↵Jeremy Kemper2007-12-221-14/+18
| | | | | | vars git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Benchmark logs for any level below or equal to the one specified, rather ↵Jeremy Kemper2007-12-211-4/+4
| | | | | | than just equal. Closes #10580 [Dan Manges] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8455 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: move from the deprecated Base64 module to ↵Jeremy Kemper2007-12-181-1/+0
| | | | | | ActiveSupport::Base64. Closes #10554. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8433 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove references to nonexistent :joins documentation. Closes #10498 [tpope]Marcel Molina2007-12-131-4/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8381 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Base.exists? doesn't rescue exceptions to avoid hiding SQL errors. Closes ↵Jeremy Kemper2007-12-111-3/+2
| | | | | | #10458. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8375 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Update destroy_all and delete_all documentation to better describe their ↵Jeremy Kemper2007-12-101-4/+27
| | | | | | tradeoffs. Closes #10447. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8367 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document Active Record exceptions. Closes #10444.Jeremy Kemper2007-12-101-91/+152
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8362 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove unused ConnectionFailed exceptionJeremy Kemper2007-12-101-2/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8361 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Axe outdated :ar_joins commentaryJeremy Kemper2007-12-101-7/+0
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8354 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that the truncation of strings longer than 50 chars should use inspect ↵David Heinemeier Hansson2007-12-061-1/+1
| | | | | | so newlines etc are escaped (closes #10385) [norbert] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8319 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* More complete documentation for find_by_sql. Closes #7912 [fearoffish]Marcel Molina2007-12-051-3/+23
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8298 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document API for exists?'s parameter and provide examples of usage. Closes ↵Marcel Molina2007-12-051-3/+12
| | | | | | #7913 [fearoffish] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8297 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document API for create's attributes parameter and provide examples. Closes ↵Marcel Molina2007-12-051-2/+11
| | | | | | #7915 [fearoffish] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8296 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Documentation for find incorrectly omits the :conditions option from various ↵Marcel Molina2007-12-051-4/+4
| | | | | | examples. Closes #7923 [mattwestcott] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8295 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document options and add examples for update. Closes #7985 [fearoffish]Marcel Molina2007-12-051-6/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8293 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document options and add examples for delete. Closes #7986 [fearoffish]Marcel Molina2007-12-051-2/+18
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8292 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document options and add examples for destroy. Closes #7988 [fearoffish]Marcel Molina2007-12-051-2/+19
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8291 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document options and add examples for update_all. Closes #7990 [fearoffish]Marcel Molina2007-12-051-5/+20
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8290 5ecf4fe2-1ee6-0310-87b1-e25e094e27de