Commit Graph

2056 Commits

Author SHA1 Message Date
Jeremy Kemper
dfa786631b Introduce the :readonly option to all associations. Records from the association cannot be saved. Closes #11084.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8864 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-13 06:32:50 +00:00
Michael Koziarski
08a4c9979d Remove options from the attributes method, tidy up the implementation. Closes #11093 [juanjo.bazan, Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8863 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-13 02:19:46 +00:00
Michael Koziarski
8739390134 Avoid cloning in Base#attributes_before_typecast. Closes #11077 [juanjo.bazan]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8858 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-11 21:02:17 +00:00
Michael Koziarski
081eed352f Fix the pre-quoted table names in the eager tests. [mislav]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8857 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-11 07:24:25 +00:00
Michael Koziarski
d4daf7bba7 Fix eager loading with pre-quoted table names. Closes #11046 [danielmorrison, Koz, Jeremy Kemper]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8856 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-11 02:50:58 +00:00
Geoff Buesing
c9402b2277 Multiparameter attributes for time columns fail over to DateTime when out of range of Time
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8855 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-10 22:46:31 +00:00
Geoff Buesing
94fa9fb745 TimeZone#new renamed #local, so that new TimeWithZone instances can be created via Time.zone.local()
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8847 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-10 17:02:22 +00:00
Michael Koziarski
2c8fb682cb Show RecordInvalid in the documentation. References #10976 [kampers]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8845 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-10 02:49:11 +00:00
Michael Koziarski
3df052ac60 Remove misleading / incorrect warning from validation documentation. Closes #8241 [quixoten, pedz, tom]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8825 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-09 08:24:35 +00:00
Michael Koziarski
cadb087deb Avoid cloning in Base#attributes. Closes #11047 [juanjo.bazan]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8824 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-08 23:35:33 +00:00
Michael Koziarski
cfb8ba0003 Add uses_tzinfo to active record tests to prevent breaking the cc.rb build etc. Closes #11034 [mpalmer]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8808 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-06 22:26:47 +00:00
Rick Olson
72385a7be6 Add Time Zone support to ActiveRecord, and config.time_zone property for 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
2008-02-06 06:43:02 +00:00
Michael Koziarski
8bc9018882 Make the docs reference the correct function. [Tobi Reif]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8802 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-04 23:29:21 +00:00
Jeremy Kemper
ac2b213135 MySQL: memoize column and table name quoting to reduce garbage
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8794 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-03 12:11:52 +00:00
Jeremy Kemper
78253acb59 Revert r8742: remove has_many with :group option since it has sketchy sql support. Closes #10480.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8790 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-03 01:09:58 +00:00
Rick Olson
5ef2b089f0 Reshuffle load order so that routes and observers are initialized after plugins and app initializers. Closes #10980 [rick, fxn]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8787 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-02 20:18:18 +00:00
Jeremy Kemper
5bbc461fcb Fix calculations on associations with custom :foreign_key. Closes #8117 [kamal, jack]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8778 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-02 04:28:42 +00:00
Jeremy Kemper
6d8534acc0 When multiparameter date assignment fails due to an invalid date, fall back 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
2008-02-02 03:37:25 +00:00
Jeremy Kemper
b1ea27630d Fix has_many :through a polymorphic has_many. Closes #10529 [Aleksey Kondratenko]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8776 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-02 03:27:31 +00:00
Michael Koziarski
6d39d05269 Avoid Base#attributes when saving / creating records. Closes #10978 [adymo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8770 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-01 23:15:57 +00:00
Jeremy Kemper
be827f9348 Fixed preloading belongs_to associations which reference a custom foreign key. References #9640.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8762 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-31 07:50:15 +00:00
Jeremy Kemper
e59978aa86 MySQL: omit text/blob defaults from the schema instead of using an empty string. Closes #10963.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8757 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-30 23:22:58 +00:00
Jeremy Kemper
859ca3a1ea Add posts.comments_count for other databases. Closes #10804.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8745 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-28 18:45:12 +00:00
Michael Koziarski
9500ad5fbc Make sure count works on has_many :through associations using :group. Closes #10480 [remvee]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8742 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-27 02:41:55 +00:00
Michael Koziarski
07132865d6 Remove dead attr_reader from association proxy. Closes #10668 [danger]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8737 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-26 08:33:48 +00:00
Michael Koziarski
c48f744400 Make sure that belongs_to counter decrements when assigning nil Closes #10804 [jeanmartin]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8735 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-26 06:23:03 +00:00
Michael Koziarski
176abc842c Add tests and documentation for allow_blank. Closes #10651 [blj]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8733 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-26 05:08:20 +00:00
Marcel Molina
b2fa70a8e1 Indicate in documentation that newer version of AR support eager loading in polymorphic associations. Closes #10861 [fxn]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8707 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-23 17:06:40 +00:00
Michael Koziarski
a91b7f1975 require test/unit explicitly otherwise the at_exit handler doesn't get called [jbarnette]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8690 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-22 08:32:50 +00:00
Michael Koziarski
91de20d621 Add options missing from earlier changeset
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8688 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-22 01:29:10 +00:00
Jeremy Kemper
32b36b8936 Add missing author_addresses.yml fixture. Closes #10592.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8682 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-21 17:21:12 +00:00
Jeremy Kemper
39814fcce0 Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/rails
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-21 17:20:51 +00:00
Jeremy Kemper
16b129a68c belongs_to supports :dependent => :destroy and :delete. Closes #10592.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8675 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 05:30:42 +00:00
Jeremy Kemper
355a8ff2cd Introduce preload query strategy for eager :includes. Closes #9640.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8672 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 04:19:53 +00:00
Jeremy Kemper
abdf546ad6 Support aggregations in finder conditions. Closes #10572.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8671 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 03:45:24 +00:00
Jeremy Kemper
3877dfc72b Remove dead code. Closes #10698 [garru]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8670 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 03:23:45 +00:00
Jeremy Kemper
aae37bb4f7 Extract ActiveSupport::Callbacks from Active Record, test case setup and teardown, and ActionController::Dispatcher. Closes #10727.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8664 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 02:44:45 +00:00
Jeremy Kemper
3ffdfa84fc Remove table quoting; only pull last_insert_id if there's a primary key.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8663 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-19 02:43:31 +00:00
Jeremy Kemper
ddbaacfd4a Organize and clean up the Active Record test suite. Closes #10742.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8662 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:31:51 +00:00
Jeremy Kemper
1e70928014 Fix paths
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8661 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:31:37 +00:00
Jeremy Kemper
42b39ae3f2 Move tests to cases
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:30:42 +00:00
Jeremy Kemper
105a27f39e move schema
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8659 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:29:00 +00:00
Jeremy Kemper
e899a83a85 move migrations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8658 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:28:07 +00:00
Jeremy Kemper
43b81d01d0 move assets and models
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:27:03 +00:00
Rick Olson
49794485b6 Ensure that modifying has_and_belongs_to_many actions clear the query cache. Closes #10840 [john.andrews]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8653 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 01:55:11 +00:00
Michael Koziarski
3b9bcf13f9 Correct fix for [8647], Closes #6868. [isak]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8650 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-16 21:56:45 +00:00
Michael Koziarski
61e550ade9 Don't ignore :precision and :scale when adding columns on postgresql. Closes #6868 [w.piekutowski]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8647 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-16 03:54:15 +00:00
Rick Olson
ebfd03b938 Fix issue where Table#references doesn't pass a :null option to a *_type attribute for polymorphic associations. Closes #10753 [railsjitsu]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8627 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-11 19:54:19 +00:00
Jeremy Kemper
7e56c72fae observed_subclasses gives [] if there are no observed classes
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8602 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-09 01:33:15 +00:00
Jeremy Kemper
8f7fa55e8d Fixtures: removed support for the ancient pre-YAML file format. Closes #10736.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8594 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-08 03:54:40 +00:00
Jeremy Kemper
9829212849 Ruby 1.9 compat: instance_eval binding to get the record binding instead of accidentally getting current Kernel#binding. Closes #10716 [Dirkjan Bussink]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8575 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-06 20:27:56 +00:00
Jeremy Kemper
ebe3a0d532 More thoroughly quote table names. Exposes some issues with sqlite2 adapter. Closes #10698.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 14:58:28 +00:00
Jeremy Kemper
139b92495f * Continue evolution toward ActiveSupport::TestCase and friends. #10679 [Josh Peek]
* TestCase: introduce declared setup and teardown callbacks. Pass a list of methods and an optional block to call before setup or after teardown. Setup callbacks are run in the order declared; teardown callbacks are run in reverse.  [Jeremy Kemper]


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8570 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:34:15 +00:00
Jeremy Kemper
b144818698 Document that .build doesn't apply to has_many :through associations. Closes #10707 [GMFlash]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8562 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 02:21:25 +00:00
Jeremy Kemper
83f65594de Prefer to instantiate fixtures with model classes instead of their names, avoiding excess constant lookups. Closes #10677 [nwilmes]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8561 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 02:20:57 +00:00
Jeremy Kemper
f42063d038 Cache fixture model class. References #10677 [nwilmes]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8560 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 02:20:26 +00:00
Jeremy Kemper
752f633bc5 Document that eager loading doesn't work with polymorphic associations. Closes #10610 [Xavier Noria]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8556 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-04 23:21:52 +00:00
Jeremy Kemper
c36f8111a6 pdate_all ignores scoped :order and :limit, so post.comments.update_all 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
2008-01-04 03:19:50 +00:00
Jeremy Kemper
25db1fc201 Ruby 1.9 compat: test multibyte chars proxy for 1.8 only
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8553 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-04 03:19:20 +00:00
David Heinemeier Hansson
2a9ad9ccbc Moved the caching stores from ActionController::Caching::Fragments::* to 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
2008-01-03 21:05:12 +00:00
Michael Koziarski
288553540b Ruby 1.9: Forwards compatibility change for fixtures and the new CSV module [JEG2]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8544 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-03 19:14:38 +00:00
Jeremy Kemper
7b8ee2438f Ruby 1.9 compat: don't use obsolete ParseDate
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8540 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-03 02:59:03 +00:00
Jeremy Kemper
f7f0e7b833 Remove toplevel rubyforgepublisher require for new Rake
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8539 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-03 02:58:43 +00:00
David Heinemeier Hansson
424c330634 Added by parameter to increment, decrement, and their bang varieties so you 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
2008-01-03 00:30:22 +00:00
Rick Olson
0ad24df6ed Optimize ActiveRecord::Base#exists? to use #select_all instead of #find. Closes #10605 [jamesh, fcheung, protocool]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8531 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-02 21:39:49 +00:00
Jeremy Kemper
4e04ec4adb Ruby 1.9 compat: fix two failing tests since String#each has been removed. Closes #10655.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8524 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-02 09:11:39 +00:00
Jeremy Kemper
20d29b3797 Ruby 1.9 compat: introduce ActiveSupport::FrozenObjectError normalize TypeError vs RuntimeError handling. Closes #10645 [Frederick Cheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-29 19:43:07 +00:00
Jeremy Kemper
07392bfe87 Ruby 1.9 compat: workaround module_eval bug. Closes #10641 [Frederick Cheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8507 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-29 05:06:06 +00:00
Rick Olson
0e3a54a3b9 Don't unnecessarily load has_many associations in after_update callbacks. Closes #6822 [stopdropandrew, canadaduane]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-28 18:01:22 +00:00
Jeremy Kemper
7555073803 Ruby 1.9 compat: introduce instance_variable_names. Closes #10630 [Frederick Cheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8499 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-28 05:42:12 +00:00
Jeremy Kemper
0c0610d398 Use extract_options! rather than Hash test + pop. Closes #10628 [ssoroka]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8496 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-28 03:58:01 +00:00
Jeremy Kemper
57c613a601 Ruby 1.9 compat: calculations don't assume array implementation of ordered hash. References #1689 [Frederick Cheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8494 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-27 11:18:30 +00:00
Jeremy Kemper
f013e047ef Ruby 1.9 compat: don't modify iterator target within block
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8487 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-27 11:16:51 +00:00
Jeremy Kemper
240b4c527e Ruby 1.9 compat: attribute methods
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8486 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-27 11:16:39 +00:00
Jeremy Kemper
38f8252e2d Remove leaky unused signal handler for transactions.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8484 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-22 19:05:26 +00:00
Jeremy Kemper
8b5f4e474f Ruby 1.9 compat: fix warnings, shadowed block vars, and unitialized instance vars
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-22 11:26:03 +00:00
Jeremy Kemper
dc901ced44 Ruby 1.9 compat: Fixtures inherits Hash instead of YAML::Omap since it's now insertion-ordered. Work around a &:procname crash.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8480 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-22 08:28:57 +00:00
Jeremy Kemper
750f15bc26 Ruby 1.9 compat: Class#subclasses is now protected
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8478 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-22 04:50:12 +00:00
Jeremy Kemper
f6379bfe15 Eager belongs_to :include infers the foreign key from the association name rather than the class name. Closes #10517.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8456 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-21 01:49:01 +00:00
Jeremy Kemper
15b38efde8 Benchmark logs for any level below or equal to the one specified, rather than just equal. Closes #10580 [Dan Manges]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8455 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-21 01:48:20 +00:00
Jeremy Kemper
b72763a96f SQLite: fix rename_ and remove_column for columns with unique indexes. Closes #10576.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8453 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-20 22:28:12 +00:00
Rick Olson
5dc831fd9a add passing test for Test::Unit subclasses running #setup properly [brynary]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-19 22:49:27 +00:00
Jeremy Kemper
0b84af9599 Revert [8392]. Closes #10568, reopens #10379.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8442 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-19 21:16:27 +00:00
Jeremy Kemper
b4e3b5d418 Ruby 1.9 compat: check column type more carefully
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8439 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-19 09:31:57 +00:00
Jeremy Kemper
7f53d0485f RubyGems 0.9.5 compat: always set the gem platform
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8438 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-19 04:21:24 +00:00
Jeremy Kemper
f91acf0258 Ruby 1.9 compat: move from the deprecated Base64 module to ActiveSupport::Base64. Closes #10554.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8433 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-18 21:14:07 +00:00
David Heinemeier Hansson
69edebf0f1 Prepare for 2.0.2 release
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8419 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-16 23:30:30 +00:00
Jeremy Kemper
3df9fb53ac More changelog updates
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8411 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-15 02:30:04 +00:00
Rick Olson
ce102e3af9 Ensure optimistic locking handles nil #lock_version values properly. Closes #10510 [rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8395 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-15 01:45:30 +00:00
Rick Olson
abd7cf343c Make the Fixtures Test::Unit enhancements more supporting for double-loaded test cases. Closes #10379 [brynary]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8392 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-15 01:23:05 +00:00
Marcel Molina
9661395d38 Remove references to nonexistent :joins documentation. Closes #10498 [tpope]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8381 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-13 19:51:44 +00:00
Marcel Molina
8945ea9ba2 Document what to pass the :accept option for validates_acceptance_of when mapping the attribute to an actual column (rather than a virtual one). Closes #10491 [xaviershay]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8379 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-13 03:33:54 +00:00
Rick Olson
d98728e091 Fix that validates_acceptance_of still works for non-existent tables (useful for bootstrapping new databases). Closes #10474 [hasmanyjosh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8377 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-12 23:55:14 +00:00
Rick Olson
66e97c34c1 Ensure that the :uniq option for has_many :through associations retains the order. #10463 [remvee]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8376 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-11 20:08:30 +00:00
Jeremy Kemper
f67add4283 Base.exists? doesn't rescue exceptions to avoid hiding SQL errors. Closes #10458.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8375 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-11 01:53:54 +00:00
Marcel Molina
fade31ad05 Remove references to ActsAs* from the README now that it's been pulled out into a plugin. Closes #10451 [sjgman9]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8371 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 19:45:14 +00:00
Jeremy Kemper
4b055a4a6a Update destroy_all and delete_all documentation to better describe their tradeoffs. Closes #10447.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8367 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 09:12:18 +00:00
Jeremy Kemper
b1ce7e4d4a Ruby 1.9 compat: File.exists\? -> File.exist\? en masse. References #1689 [Pratik Naik]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8365 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 05:54:46 +00:00
Jeremy Kemper
73673256ac Document Active Record exceptions. Closes #10444.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8362 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 04:13:33 +00:00
Jeremy Kemper
ed6949b2d7 Remove unused ConnectionFailed exception
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8361 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 03:34:05 +00:00
Jeremy Kemper
80cf698b7b More changelog updates
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8359 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 03:19:56 +00:00
Jeremy Kemper
33e9876c00 More changelog updates
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8357 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 03:19:17 +00:00
Jeremy Kemper
836f32cf7d Axe outdated :ar_joins commentary
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8354 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 01:48:14 +00:00
Jeremy Kemper
d0f192cd75 Remove empty ar_joins_test
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8353 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 01:37:11 +00:00
Jeremy Kemper
e8a85924a3 lifo -> Pratik
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8352 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 01:29:20 +00:00
Jeremy Kemper
e69a636349 More contributor name updates
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8351 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 01:16:00 +00:00
Jeremy Kemper
a93fea800f Update Chu's name in changelogs
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8349 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 01:07:49 +00:00
Jeremy Kemper
c92c8c0b28 Update Fred's name in changelogs
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8348 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 01:07:34 +00:00
Jeremy Kemper
220a64e9b6 post.comments.reload returns the association rather than the result of load_target. Closes #10438 [Fred Cheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8347 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 01:07:04 +00:00
Jeremy Kemper
1542886e40 Document the validates class method. Closes #10216 [Farley Knight]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8345 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 00:47:55 +00:00
Jeremy Kemper
77de690a56 Be careful not to reference ActiveRecord if it isn't loaded, fixing rake test when you're working without a database. [eedn]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8339 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-09 04:37:46 +00:00
David Heinemeier Hansson
1acd54a5b4 Make ready for 2.0.1
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8330 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-07 13:37:13 +00:00
David Heinemeier Hansson
7f02cdd4a0 Removed query cache rescue as it could cause code to be run twice (closes #10408) [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-07 13:34:06 +00:00
Geoff Buesing
2766f7629f Anchor DateTimeTest to fixed DateTime instead of a variable value based on Time.now#advance#to_datetime. Works around issue on 64-bit platforms with Ruby's Time#to_datetime respecting fractional seconds, and database adapters not respecting them for DateTimes, throwing off before-and-after-save equality test. References #10080, #10073
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-07 03:00:50 +00:00
David Heinemeier Hansson
731ecec15e Fixed that the Query Cache should just be ignored if the database is misconfigured (so that the "About your applications environment" works even before the database has been created) [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8325 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-06 22:05:48 +00:00
Jeremy Kemper
699da7001b The test task stops with a warning if you have pending migrations. Closes #10377.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8324 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-06 18:57:19 +00:00
David Heinemeier Hansson
729741a3fa Preparing for release shortly
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8321 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-06 18:12:48 +00:00
David Heinemeier Hansson
e16ecaf84c Fixed that the truncation of strings longer than 50 chars should use inspect so newlines etc are escaped (closes #10385) [norbert]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8319 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-06 00:01:11 +00:00
Jeremy Kemper
52fe604da3 Fix eager association test. Closes #10381 [alexey]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 22:06:26 +00:00
David Heinemeier Hansson
2e47db2fbd Fixed that habtm associations should be able to set :select as part of their definition and have that honored [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8313 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 21:53:53 +00:00
David Heinemeier Hansson
6fd1a4d502 Fixed that habtm associations should be able to set :select as part of their definition and have that honored [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8309 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 21:37:51 +00:00
Marcel Molina
ee6b6073d5 Document how the :include option can be used in Calculations::calculate. Closes #7446 [adamwiggins, ultimoamore]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8306 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 20:51:03 +00:00
Marcel Molina
aa9ed408a8 Fix typo in documentation for polymorphic associations w/STI. Closes #7461 [johnjosephbachir]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8305 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 20:24:41 +00:00
Marcel Molina
632ab246db Reveal that the type option in migrations can be any supported column type for your database but also include caveat about agnosticism. Closes #7531 [adamwiggins, mikong]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8304 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 20:20:37 +00:00
David Heinemeier Hansson
2af36bbbd4 Fix typos (closes #10378)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 18:54:41 +00:00
Marcel Molina
edf32cea3f More complete documentation for find_by_sql. Closes #7912 [fearoffish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8298 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 17:37:18 +00:00
Marcel Molina
971ed15360 Document API for exists?'s parameter and provide examples of usage. Closes #7913 [fearoffish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8297 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 17:35:17 +00:00
Marcel Molina
a23bea7c0d Document API for create's attributes parameter and provide examples. Closes #7915 [fearoffish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8296 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 17:33:18 +00:00
Marcel Molina
a7e6e009c9 Documentation for find incorrectly omits the :conditions option from various examples. Closes #7923 [mattwestcott]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8295 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 17:29:27 +00:00
Marcel Molina
1b7a18dec8 Document options and add examples for update. Closes #7985 [fearoffish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8293 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 15:17:34 +00:00
Marcel Molina
6a45e01b32 Document options and add examples for delete. Closes #7986 [fearoffish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8292 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 15:15:56 +00:00
Marcel Molina
ed69b38afa Document options and add examples for destroy. Closes #7988 [fearoffish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8291 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 15:14:40 +00:00
Marcel Molina
4f1d353b18 Document options and add examples for update_all. Closes #7990 [fearoffish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8290 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 15:13:10 +00:00
Marcel Molina
6bd7d30e75 Document options for update_counters. Closes #8091 [fearoffish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8289 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 15:06:45 +00:00
Marcel Molina
b4337c236e Add documentation about the virtual attribute added by validates_confirmation_of and its behavior. Closes #8815 [JEG2, matt, kampers]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8288 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 15:04:06 +00:00
Marcel Molina
8c2177c49d Add documentation for freeze and readonly related methods. Closes #8878 [pelargir, jeremymcanally]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8286 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 14:55:54 +00:00
Marcel Molina
4570cf66ce Document the timestamps schema definition method. Closes #9000 [mikong]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8285 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 14:47:44 +00:00
Marcel Molina
d64832c040 Give examples for what tables should be called for models inside a module namespace. Closes #10288 [scott_willson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8282 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 14:28:05 +00:00
Marcel Molina
7f671f4ae5 Document the :message option for validates_associated. Closes #10357 [dylans]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8281 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 14:24:39 +00:00
Marcel Molina
e4d845ef54 Document automatically generated predicate methods for attributes. Closes #10373 [chuyeow]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8280 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 14:22:26 +00:00
David Heinemeier Hansson
37b1d33ba3 Try again
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8273 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 02:50:18 +00:00
Jeremy Kemper
e7dab3b166 MySQL: we can't distinguish a fake 0 default in 4.x
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 02:46:28 +00:00
David Heinemeier Hansson
a5fded3e88 Fix that options[:from] table names should never be quoted [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8270 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 02:30:30 +00:00
David Heinemeier Hansson
326548770d Copy the cache too
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8260 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-03 02:22:06 +00:00
David Heinemeier Hansson
e6f54290af Added ActiveRecord::Base#becomes to turn a record into one of another class (mostly relevant for STIs) [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8259 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-03 02:01:21 +00:00
David Heinemeier Hansson
c4cb2dd014 Fixed that to_xml should not automatically pass :procs to associations included with :include (closes #10162) [chuyeow]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8258 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-03 01:47:21 +00:00
Marcel Molina
c84c0437d7 Fix documentation typo introduced in [8250]. Closes #10339 [Henrik N]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8256 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-02 19:54:18 +00:00
Jeremy Kemper
e7c5da6260 Handle 8.1 default formatting. Closes #10333 [Tim Pope]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8254 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-02 03:33:58 +00:00
Michael Koziarski
c01c28c304 Warn users about the race condition in validates_uniqueness_of. [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8250 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-01 23:12:49 +00:00
Tobias Lütke
a25b2e116c Removed documentation for the removed rollback! method on transactions and mention ActiveRecord::Rollback [cody]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8240 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-29 22:25:42 +00:00