Commit Graph

1907 Commits

Author SHA1 Message Date
Marcel Molina
27941f649f Update add_index documentation to use new options api. Closes #9787 [kamal]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8031 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-26 03:55:22 +00:00
Marcel Molina
bf658a906b Allow find on a has_many association defined with :finder_sql to accept id arguments as strings like regular find does. Closes #9916 [krishna]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8030 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-26 03:42:28 +00:00
Marcel Molina
8b2a6014a2 Use VALID_FIND_OPTIONS when resolving :find scoping rather than hard coding the list of valid find options. Closes #9443 [sur]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8025 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-26 03:20:14 +00:00
Michael Koziarski
96557eb35b Remove superfluous code and quote table name. References #9971 [jkit, nzkoz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8015 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-25 18:53:07 +00:00
Michael Koziarski
11d2a309c5 Make clear_reloadable_connections! take account of @@allow_concurrency. Closes #7579 [wilson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8014 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-25 08:09:41 +00:00
Michael Koziarski
2d208eb3a0 Make sure that the Schema Dumper supports non-standard primary keys with MySQL. Closes #9971 [RubyRedRick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8012 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-25 06:42:05 +00:00
Marcel Molina
c8b6b4821f Limited eager loading no longer ignores scoped :order. Closes #9561 [danger, josh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8006 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-23 18:34:01 +00:00
Jeremy Kemper
7b42a1d0ac Assigning an instance of a foreign class to a composed_of aggregate calls an optional conversion block. Refactor and simplify composed_of implementation. Closes #6322.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8003 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-23 17:39:35 +00:00
Jeremy Kemper
c220e558be Assigning nil to a composed_of aggregate also sets its immediate value to nil. Closes #9843.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8002 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-23 17:29:42 +00:00
Jeremy Kemper
28729a4829 validates_uniqueness_of behaves well with abstract superclasses. References #3833, closes #9886.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8000 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-23 06:18:42 +00:00
Jeremy Kemper
902533e6f0 Reinstate test_change_column_nullability for all adapters. Closes #9945 [lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7996 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-22 23:52:04 +00:00
Jeremy Kemper
e829e12e16 test_select_rows shouldn't depend on implicit result ordering. Closes #9898 [lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7995 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-22 23:50:12 +00:00
Rick Olson
7042163d76 Ensure that mysql quotes table names with database names correctly. Closes #9911 [crayz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7980 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-20 21:17:31 +00:00
Michael Koziarski
17ac677a2d typo in test name
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7977 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-19 02:51:44 +00:00
Michael Koziarski
3facc8578b Few more tests for Sexy Migrations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7975 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-19 02:25:23 +00:00
Michael Koziarski
637c685a42 Forgotten changelog entry
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7974 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-19 02:25:09 +00:00
Michael Koziarski
6ddde027c4 Add t.belongs_to and t.references to sexy migrations [arthurgeek]
Test harness for Sexy Migrations. [Koz]
Closes #9775


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7973 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-19 02:09:06 +00:00
Michael Koziarski
210f7e29e2 Move all Schema creation into schema.rb for Mysql. Closes #9899 [mikong, lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7972 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-19 01:52:50 +00:00
Jeremy Kemper
2fac5d1a8b SQL Server: test for affected row count. References #9558 [lawrence, ryepup]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7968 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-18 23:47:59 +00:00
Michael Koziarski
2833706699 Read in binary mode to make sure windows support keeps working. [lawrence] Closes #9912
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7959 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-17 22:50:34 +00:00
Michael Koziarski
8ed1e885b7 Use a smaller binary fixture so we don't overflow column size limitations in some commercial / legacy databases. Closes #7987 [roderickvd, lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7958 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-17 21:35:46 +00:00
Michael Koziarski
ac3cf43182 Raise an intelligible error message when migration aren't named correctly [bronson] Closes #9909
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7957 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-17 21:35:19 +00:00
Jeremy Kemper
f575757ca4 Qualified column names work in hash conditions, like :conditions => { 'comments.created_at' => ... }. Closes #9733.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7943 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-16 08:08:08 +00:00
Jeremy Kemper
cfbd790ad3 Fix regression where the association would not construct new finder SQL on save causing bogus queries for "WHERE owner_id = NULL" even after owner was saved. Closes #8713.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7942 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-16 07:24:23 +00:00
Jeremy Kemper
a72c1ec43e Refactor association create and build so before & after callbacks behave consistently. Closes #8854.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7935 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-16 05:07:58 +00:00
Jeremy Kemper
9b6207c3d0 Quote table names. Defaults to column quoting. Closes #4593.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7932 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-16 05:06:33 +00:00
Jeremy Kemper
e7ed4c9354 Fix join table docs error in schema_statements. Closes #9880 [lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7931 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-16 05:05:47 +00:00
Jeremy Kemper
197c888576 Moving SQL Server tests to the extracted adapter. References #9884.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7930 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-16 05:05:22 +00:00
Jeremy Kemper
671228942d Alias association #build to #new so it behaves predictably. Closes #8787.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7913 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 08:09:04 +00:00
Jeremy Kemper
333463679a Revert [7894] and apply to adapter instead. References #9588.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7912 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 07:57:06 +00:00
Jeremy Kemper
660a696a3f Test that change_column quotes column names. Closes #9537 [lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 07:33:53 +00:00
Jeremy Kemper
9f5a9aa35f Factor out checks for duplicable objects. Closes #9333.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7908 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 07:13:40 +00:00
Michael Koziarski
fe234a1538 Fix Json related documentation for render and the AR serializer. Closes #9814. Closes #9833. [chuyeow]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7905 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 07:04:10 +00:00
Michael Koziarski
347b911a74 Remove seemingly misleading 'faster tests' instructions too
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7903 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 06:48:27 +00:00
Michael Koziarski
0d0fd2142b Update the instructions for running tests.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7902 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 06:48:16 +00:00
Jeremy Kemper
e81f1acc33 Uncomment test for join model method_missing. Closes #8707 [Giles Bowkett, Josh Peek]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7897 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 04:14:10 +00:00
Jeremy Kemper
619f2897f5 Update test/all.sh
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7896 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 03:46:15 +00:00
Jeremy Kemper
6cc7095320 Update IGNORED_SQL for SQL Server. Closes #9638 [lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7895 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 03:32:00 +00:00
Jeremy Kemper
5d3e72486b Add build/drop/rebuild tasks for SQL Server. Closes #9588 [lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7894 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 03:30:47 +00:00
Jeremy Kemper
bfe85ae0e8 Add explicit test task
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7889 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 00:10:09 +00:00
Rick Olson
c1bc61cba0 Add notes to documentation regarding attr_readonly behavior with counter caches and polymorphic associations. Closes #9835 [saimonmoore, rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7873 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-14 05:32:57 +00:00
Rick Olson
f56dd107cd Observers can observe model names as symbols properly now. Closes #9869 [queso]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-14 05:20:24 +00:00
David Heinemeier Hansson
faff774f9d Update versions here too
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7843 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-12 16:03:54 +00:00
Jeremy Kemper
cff25aae90 eval with __FILE__ and __LINE__
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7827 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-10 23:01:18 +00:00
Tobias Lütke
0ad5365bf4 find_and_(initialize|create)_by methods can now properly initialize protected attributes
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7826 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-10 19:11:50 +00:00
Michael Koziarski
1c881ca5bf Ensure that 'autosaving' works when associations aren't loaded [Bryan Helmkamp] References #8713
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7824 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-10 06:45:13 +00:00
Jeremy Kemper
aa04635d8e Update :dependent docs and improve its argument error message.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7813 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-09 00:32:36 +00:00
Jeremy Kemper
cdc3c246c6 belongs_to infers the foreign key from the association name instead of from the class name. Fulfills the 1.2.4 deprecation.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7812 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 23:39:28 +00:00
Michael Koziarski
3122d321fd Make sure AR::Base#clone handles attr changes made in after_initialize hooks. Closes #7191 [weyus]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7802 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 06:21:38 +00:00
Jeremy Kemper
4eaa8ba5be PostgreSQL: support multiline default values. Closes #7533.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7801 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 06:17:53 +00:00
Jeremy Kemper
9319361328 Dr Math meets Captain Obvious.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7798 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 05:41:19 +00:00
Jeremy Kemper
346d36bfba Namespace the internal Rakefile tasks. Closes #8850 [drnic]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7795 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 05:29:09 +00:00
Jeremy Kemper
85c86f0999 MySQL: fix change_column on not-null columns that don't accept dfeault values of ''. Closes #6663.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7790 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 03:28:28 +00:00
Michael Koziarski
ce47db3366 Change Migration documentation to use the new syntax. Closes #9813 [sjgman9]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7788 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 03:18:18 +00:00
Jeremy Kemper
210ecaecc3 validates_uniqueness_of behaves well with single-table inheritance. Closes #3833.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7787 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 01:44:55 +00:00
Jeremy Kemper
bd087e6716 Use fast date/time parsing by default. Closes #9811.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7780 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-07 22:01:59 +00:00
Jeremy Kemper
c79dfd36dc Closed wrong ticket. Closes #9802, reopens #9699.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7778 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-07 19:45:07 +00:00
Jeremy Kemper
84a14f2620 Raise ProtectedAttributeAssignmentError in development and test environments when mass-assigning to an attr_protected attribute. Closes #9699.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7777 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-07 19:43:19 +00:00
Jeremy Kemper
c7c3f73fd9 Reinstate failsafe date/time parsing rescues. Head off some obvious failures like year == 0 or nil.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7771 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-07 06:27:39 +00:00
Jeremy Kemper
8d7eb30898 MySQL: speedup date/time parsing.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7769 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-07 05:29:37 +00:00
Jeremy Kemper
a76fa613d3 Check for the dir instead of relying on an exception.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7768 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-07 05:25:36 +00:00
Michael Koziarski
cd64471bdb Fix calling .clear on a has_many :dependent=>:delete_all association. [tarmo] Closes #6904
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7767 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-07 05:05:12 +00:00
Michael Koziarski
5a276643d1 Allow change_column to set NOT NULL in the PostgreSQL adaptor. Closes #3904 [tarmo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7766 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-07 04:52:09 +00:00
Jeremy Kemper
fe0df25f7b Move misplaced CHANGELOG entry
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7755 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 01:26:48 +00:00
Michael Koziarski
8ef4bc6c75 Missed the add
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7754 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 01:03:19 +00:00
Michael Koziarski
638505b90f Send the correct INSERT statement when dealing with objects with only primary keys. Closes #9523 [tarmo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7753 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 00:49:58 +00:00
Michael Koziarski
4db718e2bb Only cache attributes which need it for performance reasons. Closes #9767 [skaes]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7752 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 00:48:43 +00:00
Jeremy Kemper
b96c298f47 Test for each JSON fragment to workaround assumed hash ordering.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7751 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 00:40:28 +00:00
Jeremy Kemper
55640fb939 Simplify some JSON tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7750 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 00:33:51 +00:00
Rick Olson
5b2e8b1eb1 Fix that ActiveRecord would create attribute methods and override custom attribute getters if the method is also defined in Kernel.methods. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7749 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 00:25:07 +00:00
Rick Olson
24c2457a26 Don't call attr_readonly on polymorphic belongs_to associations, in case it matches the name of some other non-ActiveRecord class/module. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7748 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-05 19:27:33 +00:00
Jeremy Kemper
335c15005d Bump versions for 1.2.4 release.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7744 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-05 05:20:37 +00:00
Jeremy Kemper
b1968708e1 Hash#to_json takes :only or :except options to specific or omit certain hash keys. Enumerable#to_json passes through its options to each element. Closes #9751.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7736 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-04 03:28:42 +00:00
Jeremy Kemper
a30a1a9d5f Try loading activerecord-<adaptername>-adapter gem before trying a plain require so you can use custom gems for the bundled adapters. Also stops gems from requiring an adapter from an old Active Record gem.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7735 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-04 01:08:10 +00:00
Tobias Lütke
406ea8f31d only create custom accessors for Kernel:: methods
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7731 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-03 21:48:49 +00:00
Tobias Lütke
b31aa639e7 Allow column accessors to be created even if Kernel. or Object# methods of the same name exist.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7729 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-03 20:47:33 +00:00
Michael Koziarski
b4ec9904c6 Cache the descends_from_activerecord? call to speed up query generation. [skaes] Closes #9765
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7723 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-03 05:31:36 +00:00
Jeremy Kemper
0ee1cb2cd3 Ruby 1.9 compat, consistent load paths
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-02 05:32:14 +00:00
David Heinemeier Hansson
7275d2749c Fixed JSON encoding to use quoted keys according to the JSON standard (closes #8762) [choonkat/chuyeow]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7697 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-30 20:57:50 +00:00
Rick Olson
66d05f5e2c Add attr_readonly to specify columns that are skipped during a normal ActiveRecord #save operation. Closes #6896 [dcmanges]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7693 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-30 07:09:44 +00:00
Rick Olson
30a652ad41 Make size for has_many :through use counter cache if it exists. Closes #9734 [xaviershay]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7692 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-30 06:47:20 +00:00
Jeremy Kemper
e5a60fb2bf Don't implicitly assign instance variables by using them as block arguments
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7691 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-30 06:22:39 +00:00
Jeremy Kemper
c9bfd7d543 Remove DB2 adapter since IBM chooses to maintain their own adapter instead.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7690 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-29 23:20:36 +00:00
Jeremy Kemper
4158e54d75 Extract Oracle, SQLServer, and Sybase adapters into gems.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7689 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-29 23:18:38 +00:00
Jeremy Kemper
d41ea51d39 Ruby 1.9 compat for instance method check in Mysql adapter.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7688 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-29 23:18:24 +00:00
David Heinemeier Hansson
f18356edb7 Updated CHANGELOGs. They need to be filtered for duplicates
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7685 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-29 22:18:26 +00:00
Jeremy Kemper
26174b2881 Failing counter cache test. References #6896.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7675 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 23:55:50 +00:00
David Heinemeier Hansson
191a0484f0 Missing test
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7674 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 21:11:14 +00:00
Jeremy Kemper
b095ce63f2 Fixtures test fixes and general cleanup. Closes #9682 [norbert]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7667 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 14:56:07 +00:00
David Heinemeier Hansson
e3b49c052b Fixed spelling errors (closes #9706) [tarmo/rmm5t]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 14:18:47 +00:00
Jeremy Kemper
7cb1f93bcc MySQL: change_column raises if the table or column doesn't exist.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7665 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 14:10:51 +00:00
David Heinemeier Hansson
bbdb4e55f6 Added :include option to to_json (closes #9677) [chuyeow]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7663 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 14:07:23 +00:00
David Heinemeier Hansson
078bd0515e Added fixture caching thatll speed up a normal fixture-powered test suite between 50% and 100% (closes #9682) [frederick.cheung@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7662 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 14:05:03 +00:00
Jeremy Kemper
4965b1b961 Correctly quote id list for limited eager loading. Closes #7482.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7588 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 23:51:03 +00:00
David Heinemeier Hansson
5757fb61d8 self.fixture_class_names is defined twice in fixtures.rb (closes #7135) [jarkko]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7584 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 23:17:01 +00:00
David Heinemeier Hansson
0b2e059f0a Removed unnecessary or statement (closes #7158) [richcollins]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7583 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 23:15:54 +00:00
Michael Koziarski
1abe5a2ded Fix broken mysql test [frederick.cheung@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7579 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 22:33:51 +00:00
David Heinemeier Hansson
766fbce04e Fixed that using version-targetted migrates would fail on loggers other than the default one (closes #7430) [valeksenko]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7577 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 22:18:55 +00:00
David Heinemeier Hansson
0442f1ea75 Docfix (closes #7593) [tarmo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7570 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 18:35:41 +00:00
David Heinemeier Hansson
046a87a855 Fixed rename_column for SQLite when using symbols for the column names (closes #8616) [drodriguez]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 18:23:30 +00:00
David Heinemeier Hansson
286bd9b9f0 Docfix (closes #8767) [kampers]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7561 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 18:17:53 +00:00
David Heinemeier Hansson
18a24274ec Allow frameworks to be required by their gem name (closes #8845) [drnic]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7560 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 18:15:05 +00:00
David Heinemeier Hansson
00326bb0b4 Make date tests pass on 64-bit (closes #9121) [mutru]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7556 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 17:57:10 +00:00
David Heinemeier Hansson
0f3d8707db Removed unused @join_sql reference (closes #9174) [danger]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7554 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 17:53:39 +00:00
David Heinemeier Hansson
0faa4ca04c Doc fix (closes #9323) [Henrik N]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7549 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 17:39:55 +00:00
David Heinemeier Hansson
e38ad5ddcc Added the possibility of using symbols in addition to concrete classes with ActiveRecord::Observer#observe #3998 [robbyrussell/tarmo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7539 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 17:05:15 +00:00
David Heinemeier Hansson
5e8d8eacf3 Import the right database for testing (closes #9589) [lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7536 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 14:25:31 +00:00
David Heinemeier Hansson
0d5a7d1d8c Stress that you should really install the C-based MySQL library when running on the pure Ruby one (closes #9507)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7521 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-20 23:40:48 +00:00
David Heinemeier Hansson
e86d1cd621 Added ActiveRecord::Base#to_json/from_json (currently does not support :include like to_xml) [DHH]. Added ActiveRecord::Base#from_xml [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7519 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-20 23:22:30 +00:00
Michael Koziarski
7010ee361e Stop users from calling .create on a has_many / habtm association when the owner is a new_record?
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7511 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-18 10:26:56 +00:00
Tobias Lütke
4a1388adea Define dynamic finders as real methods after first usage. Close #9317
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-18 10:04:11 +00:00
Jeremy Kemper
7495b5ca75 Deprecation: remove deprecated threaded_connections methods. Use allow_concurrency instead.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7509 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-18 06:43:05 +00:00
Jeremy Kemper
81d619ea0d Associations macros accept extension blocks alongside modules. Closes #9346.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-17 21:19:44 +00:00
Jeremy Kemper
6b1901da8f Don't worry about retrieving the last inserted id. [tarmo_t]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7503 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-17 20:43:02 +00:00
Michael Koziarski
acbec3e565 Ensure that custom mutators aren't redefined by define_attribute_methods. [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7500 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-17 09:29:02 +00:00
Jeremy Kemper
bfb906a905 Speed up and simplify query caching.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7498 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-17 06:15:58 +00:00
Jeremy Kemper
30fb7b8c8b connection.select_rows 'sql' returns an array (rows) of arrays (field values). Closes #2329.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7497 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-16 03:32:47 +00:00
Jeremy Kemper
78da29a84f Typo
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7496 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-16 00:23:52 +00:00
Jeremy Kemper
b8657089f2 Eager loading respects explicit :joins. Closes #9496.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7494 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-15 23:50:12 +00:00
Jeremy Kemper
a6083b86d1 Extract Firebird, FronBase, and OpenBase adapters into gems. Closes #9508, #9509, #9510.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7492 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-15 23:22:58 +00:00
Jeremy Kemper
f92503c541 RubyGem database adapters: expects a gem named activerecord-<database>-adapter with active_record/connection_adapters/<database>_adapter.rb in its load path.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7491 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-15 23:21:21 +00:00
David Heinemeier Hansson
0b0931e150 Added block-acceptance to JavaScriptHelper#javascript_tag (closes #7527) [BobSilva/tarmo/rmm5t]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7485 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-15 21:34:25 +00:00
David Heinemeier Hansson
79202b37dc Fixed that altering join tables in migrations would fail w/ sqlite3 #7453 [TimoMihaljov/brandon]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7484 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-15 21:23:05 +00:00
Jeremy Kemper
498d8ff72e Fix association writer with :dependent => :nullify. Closes #7314.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-14 07:29:22 +00:00
Jeremy Kemper
e6941149ab Deprecation: removed Reloadable.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7473 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-14 00:25:59 +00:00
Jeremy Kemper
f7c371dff8 OpenBase: update for new lib and latest Rails. Support migrations. Closes #8748.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7472 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-13 23:21:14 +00:00
Jeremy Kemper
54a6ed1482 minor speedups + forward-compat syntax
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7471 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-13 23:13:34 +00:00
Jeremy Kemper
f9ba8566b5 minor speedup
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7469 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-13 08:20:08 +00:00
Jeremy Kemper
b4ad9e0cb9 Kill lingering acts
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7460 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-11 06:47:27 +00:00
Jeremy Kemper
5f73c46741 Remove empty acts
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7459 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-11 06:24:13 +00:00
David Heinemeier Hansson
ea0975a20b Moved acts_as_tree into a plugin of the same name on the official Rails svn (closes #9514) [lifofifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7454 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-11 03:25:59 +00:00
David Heinemeier Hansson
11f4d28344 Moved acts_as_nested_set into a plugin of the same name on the official Rails svn (closed #9516) [josh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7453 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-11 03:09:37 +00:00
Michael Koziarski
bf8a4b0006 Remove broken require
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-10 04:53:46 +00:00
Michael Koziarski
aa36ca1c5f Remove acts_as_list. Users are advised to install the new plugin. References #9415. [josh, nzkoz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7444 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-10 04:41:09 +00:00
David Heinemeier Hansson
ddf385a554 Remove the wrapping feature that was never actually turned into something real [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7440 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-09 23:39:10 +00:00
David Heinemeier Hansson
250f871b90 Removed outdated benchmarks and examples
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7439 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-09 23:30:09 +00:00
David Heinemeier Hansson
85800c110e Update copyright span
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7425 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-09 17:57:16 +00:00
Jeremy Kemper
7ace0a654c Match Fixnum and Float in particular. Rescue dup error and return result.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7420 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-08 04:53:29 +00:00
Jeremy Kemper
2894887925 Explicitly require active_record/query_cache before using it.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7419 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-08 04:31:26 +00:00
Michael Koziarski
bc41e8a449 Add credit where due. References #8446
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7410 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-05 23:33:27 +00:00
Michael Koziarski
0d696f09ac Fix assertion for the mysql default work around committed earlier.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7408 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-05 05:38:19 +00:00
Michael Koziarski
aa32f66ebb Add :allow_blank to validations. Like allow_nil, but for values which are +blank?+. [jnoon] Closes #7383
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7407 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-05 05:37:52 +00:00
Rick Olson
51977bc261 Fix bug where unserializing an attribute attempts to modify a frozen @attributes hash for a deleted record. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7406 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-04 17:32:48 +00:00
Michael Koziarski
3bbef581af Work around mysql limitations for defaults on text columns with not null. Closes #9324 [caio]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7405 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-04 02:44:10 +00:00
Michael Koziarski
6246fad19a Remove deprecated functionality from edge rails. Closes #9387 [lifofifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7402 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-03 00:17:09 +00:00
Michael Koziarski
b18d9568a6 Ensure QueryCache doesn't try to dup numeric results (does not affect the major OS database). Closes #7661 [tomafro, nzkoz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7399 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-02 23:52:58 +00:00
Jeremy Kemper
55efae2387 Performance: absorb instantiate and initialize_with_callbacks into the Base methods.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7380 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-31 01:56:39 +00:00
Michael Koziarski
45ea329bcd Remove commented out test which refers to old code, old bugs and uses ObjectSpace in a nasty way. [nzkoz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7371 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-29 03:33:26 +00:00
Michael Koziarski
18a3333a30 Formatting, grammar and spelling fixes for the associations documentation. [seanhussey] Closes #8899
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7368 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-28 23:18:57 +00:00
Michael Koziarski
c11ca0e0bf Fix documentation error in xml serialization. [matt] Closes #9001
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7367 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-28 23:18:14 +00:00
Michael Koziarski
5972fd493b Formatting and grammatical fixes for the acts_as_* documentation [seanhussey, kampers] Closes #9107
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7366 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-28 23:17:49 +00:00
Michael Koziarski
5840108b6e Pass the right binding when string is passed to :if with validations. [caspercg] Closes #9300
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7365 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-28 23:17:17 +00:00
Michael Koziarski
93eaaef43c Use extract_options instead of ad-hoc partial implementations. [norbert] Closes #9313
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7364 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-28 23:16:49 +00:00
Michael Koziarski
5cbc782ece Remove unnecessary loop in validates_presence_of. [sur] Closes #9392
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7362 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-28 23:15:47 +00:00
Michael Koziarski
016947ceed Make sure create! raises errors on validation when creating multiple records. [hasmanyjosh] Closes #8952
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7361 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-28 20:44:51 +00:00
David Heinemeier Hansson
d24c73dedb Fix spacing
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7356 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-21 22:11:14 +00:00
David Heinemeier Hansson
3566be4728 Fixed that eager loading queries and with_scope should respect the :group option [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7355 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-21 21:58:38 +00:00
David Heinemeier Hansson
0e452bb02d Fixed that eager loading queries should respect the :group option as well [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7354 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-21 21:29:21 +00:00
Michael Koziarski
29b0707f07 Improve performance and functionality of the postgresql adapter. Closes #8049 [roderickvd]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-16 06:26:30 +00:00
Michael Koziarski
f008566d65 Don't clobber :includes passed to count on has_many association. Closes #9175 [danger]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-16 04:37:31 +00:00
Michael Koziarski
82b244e3ff Make sure has_many associations honour :include when counting. Closes #9167 [danger]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7325 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-16 04:36:55 +00:00
Michael Koziarski
7b64c37479 Add forgotten changelog entry
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7316 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-14 08:53:15 +00:00
Michael Koziarski
5b801b5960 Change the implementation of ActiveRecord's attribute reader and writer methods:
* Generate Reader and Writer methods which cache attribute values in hashes.  This is to avoid repeatedly parsing the same date or integer columns.
 * Move the attribute related methods out to attribute_methods.rb to de-clutter base.rb
 * Change exception raised when users use find with :select then try to access a skipped column.  Plugins could override missing_attribute() to lazily load the columns.
 * Move method definition to the class, instead of the instance
 * Always generate the readers, writers and predicate methods.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-14 08:53:02 +00:00
Michael Koziarski
d4bf5e9b34 Make habtm respect the :select option. Closes #9207. [Aleksey Kondratenko]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7279 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-07 09:53:33 +00:00
Michael Koziarski
bb94ce92fc Let inspect on AR classes work when the table doesn't exist. Closes #9194 [tarmo, nzkoz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7278 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-06 00:18:50 +00:00
Michael Koziarski
c4c6662498 Performance enhancement for Base.exists?. CLoses #8769. [hasmanyjosh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7274 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-05 00:57:43 +00:00
Rick Olson
ea07212d97 dont call #collect on a string when returning query cache results. Closes #9099 [norbert]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7239 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-25 13:05:58 +00:00
Rick Olson
f5ea6f880f Perform a deep #dup on query cache results so that modifying activerecord attributes does not modify the cached attributes. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7238 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-25 03:48:30 +00:00
Rick Olson
d51e7f8252 Ensure that has_many :through associations use a count query instead of loading the target when #size is called. Closes #8800 [lifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7237 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-25 03:09:21 +00:00
Rick Olson
b49fcde7e5 tiny doc patches [lifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7236 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-25 03:05:55 +00:00
Rick Olson
2d7afe4456 misc doc fixes + Add ActiveResource to Rails::Info. Closes #8741, #9008, #9089 [kampers]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7235 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-25 02:50:35 +00:00
David Heinemeier Hansson
edd68a587f Refactored in use of extract_options! (closes #9079) [josh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7220 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-24 16:48:57 +00:00
David Heinemeier Hansson
1e1f93fd10 Added :unless clause to validations (closes #8003) [monki]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7215 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-24 01:48:17 +00:00
Rick Olson
3029a76af3 Fix #count on a has_many :through association so that it recognizes the :uniq option. Closes #8801 [lifofifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7199 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-20 00:10:06 +00:00
Rick Olson
a413056407 Fix and properly document/test count(column_name) usage. Closes #8999 [lifofifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7192 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-17 20:16:35 +00:00
Rick Olson
872c5f4380 Remove deprecated count(conditions=nil, joins=nil) usage. Closes #8993 [lifofifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7189 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-16 20:26:10 +00:00
Rick Olson
4ef5af8d4d Change belongs_to so that the foreign_key assumption is taken from the association name, not the class name. Closes #8992 [hasmanyjosh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7188 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-16 20:21:36 +00:00
Michael Koziarski
ddb00f1078 Remove spurious tests from deprecated_associations_test, most of these aren't deprecated, and are duplicated in associations_test. Closes #8987 [lifofifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7187 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-15 01:16:40 +00:00
Michael Koziarski
816522ecd8 Make create! on a has_many :through association return the association object. Not the collection. Closes #8786 [lifofifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7182 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-11 23:54:43 +00:00
Tobias Lütke
187e1f85d0 Support for non heterogeneous arrays when serializing to xml. Unless guessable from array name the type name will be included as attribute
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7173 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-09 22:07:39 +00:00
Tobias Lütke
5b2be62934 Make [7169] work as expected with indented XML.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7171 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-09 19:10:45 +00:00
Tobias Lütke
049b1440a3 Include empty has_many/has_and_belongs_to_many associations as empty array tags when serializing to XML
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7169 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-09 18:13:24 +00:00
Michael Koziarski
3fbfc13ee3 Move from select * to select tablename.* to avoid clobbering IDs. Closes #8889 [dasil003]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7167 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-07 02:42:42 +00:00
Michael Koziarski
d0ff4ec193 Don't call unsupported methods on associated objects when using :include, :method with to_xml [manfred, jwilger] Closes #7307
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-30 03:31:48 +00:00
Tobias Lütke
817d5d489d Add the type="array" moniker to has_many / has_and_belongs_to_many associations upon serialization.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7144 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-27 16:37:40 +00:00
Jeremy Kemper
b5b16a80a9 Define collection singular ids method for has_many :through associations. Closes #8763.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7137 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-27 08:19:12 +00:00
Jeremy Kemper
02311a5db1 Array attribute conditions work with proxied association collections. Closes #8318.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7133 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-27 02:56:11 +00:00
David Heinemeier Hansson
08d23d5375 Allow sweepers to be created solely for expiring after controller actions, not model changes [DHH] Added assigns method to ActionController::Caching::Sweeper to easily access instance variables on the controller [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7128 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-26 20:45:41 +00:00
Jeremy Kemper
89c79b8b95 Fix polymorphic has_one associations declared in an abstract class. Closes #8638.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7119 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-25 22:42:19 +00:00
David Heinemeier Hansson
1a0cdf74be Docfix (closes #8096)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7107 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-23 17:52:50 +00:00
David Heinemeier Hansson
b0391d133a Docfix (closes #8674)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7101 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-23 17:34:41 +00:00
David Heinemeier Hansson
279113f9b3 Fixed validates_associated should not stop on the first error (closes #4276) [mrj/manfred/josh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7094 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-23 17:01:00 +00:00
Jeremy Kemper
048dcf31c9 Mock the beginning of the transaction also. References #8642.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7089 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-23 01:58:41 +00:00
Jeremy Kemper
c627590fd4 Rollback if commit raises an exception. Closes #8642.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7088 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-23 00:54:51 +00:00
Jeremy Kemper
dae6108998 Update tests' use of fixtures for the new collections api. Closes #8726.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7081 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-22 17:36:20 +00:00
Jeremy Kemper
989332c734 Save associated records only if the association is already loaded. Closes #8713.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7075 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-21 20:47:26 +00:00
Jeremy Kemper
eb2e30ef24 MySQL: fix show_variable. Closes #8448.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7071 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-20 18:30:35 +00:00
Rick Olson
6af2cbca07 remove extra debug line. Closes #8681 [Giles Bowkett]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7059 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-18 23:57:00 +00:00
Jeremy Kemper
b94f8e1d29 Remove deprecated quote methods, replaced by quote_value so quote can be used as an attribute name.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7000 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-11 08:06:07 +00:00
Jeremy Kemper
7858a32e1b Remove deprecated find_first and find_all.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6998 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-11 07:45:56 +00:00