Commit Graph

900 Commits

Author SHA1 Message Date
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
Jeremy Kemper
813e8ba93b Fix Base#inspect when not every attribute is present. Closes #8623.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6995 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-11 05:02:42 +00:00
Jeremy Kemper
9b444fe73b Rollback [6961] which breaks SQLite tests. Reference #7345.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6965 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-08 01:40:05 +00:00
Jeremy Kemper
869a172a8a Migrations: raise if a column is duplicated. Closes #7345.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6961 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-07 23:25:50 +00:00
Jeremy Kemper
8d6d450303 Fixtures: correctly delete and insert fixtures in a single transaction. Closes #8553.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6944 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-05 04:37:05 +00:00
Jeremy Kemper
673daeabca Fixtures: people(:technomancy, :josh) returns both fixtures. Closes #7880.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6940 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-05 03:47:02 +00:00
Jeremy Kemper
b05fc40b5d Calculations support non-numeric foreign keys. Closes #8154.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6919 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-01 03:26:51 +00:00
Jeremy Kemper
1edd21bb02 with_scope is protected. Closes #8524.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-30 21:40:55 +00:00
Jeremy Kemper
ff6d2aae0a Quickref for association methods. Closes #7723.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6905 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-30 07:05:14 +00:00
Jeremy Kemper
1f802968c5 Calculations: return nil average instead of 0 when there are no rows to average. Closes #8298.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6904 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-30 06:57:04 +00:00
Jeremy Kemper
b2681cca2e acts_as_nested_set: direct_children is sorted correctly. Closes #4761.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6903 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-30 06:34:25 +00:00
Jeremy Kemper
af98d883b9 Raise an exception if both attr_protected and attr_accessible are declared. Closes #8507, #6004.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6896 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-29 20:35:46 +00:00
Jeremy Kemper
69e4cc6e31 SQLite, MySQL, PostgreSQL, Oracle: quote column names in column migration SQL statements. Closes #8466.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6889 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-29 07:21:41 +00:00
Rick Olson
4472a30aad Allow nil serialized attributes with a set class constraint. #7293 [sandofsky]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6879 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-28 15:51:53 +00:00
Jeremy Kemper
33e96f3cb3 Oracle binary fixtures; pull fixture insertion into the adapters. Closes #7987.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6859 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 06:26:50 +00:00
Jeremy Kemper
d0d5a1fe23 Announce migration versions as they're performed.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6855 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 02:36:55 +00:00
Jeremy Kemper
2be3a33f32 find gracefully copes with blank :conditions. Closes #7599.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6852 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 00:35:49 +00:00
Jeremy Kemper
64d655628c validates_numericality_of takes :greater_than, :greater_than_or_equal_to, :equal_to, :less_than, :less_than_or_equal_to, :odd, and :even options. Closes #3952.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6850 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 00:30:14 +00:00
Jeremy Kemper
ed2a84f99b MySQL: create_database takes :charset and :collation options. Charset defaults to utf8. References #8448.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6848 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 00:20:37 +00:00
Jeremy Kemper
109926c5a3 Find with a list of ids supports limit/offset. Closes #8437.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6845 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-25 21:56:21 +00:00
Jeremy Kemper
c4a31560bd Optimistic locking: revert the lock version when an update fails. Closes #7840. Also return the number of affected rows instead of true.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6843 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-25 21:31:44 +00:00
Jeremy Kemper
38deb0ed83 Migrations: add_column supports custom column types. Closes #7742. First-patch cheers to jsgarvin\!
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6842 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-25 21:21:41 +00:00
Jeremy Kemper
cb7a17a9d0 Load database adapters on demand. Eliminates config.connection_adapters and RAILS_CONNECTION_ADAPTERS. Closes #8456.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6833 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-25 03:19:35 +00:00
Rick Olson
04354cd4c2 update changelog too
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6828 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-24 20:40:14 +00:00
Jeremy Kemper
4afd6c9f0a belongs_to assignment creates a new proxy rather than modifying its target in-place. Closes #8412.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6804 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-22 03:39:36 +00:00
Rick Olson
96bc3d224d Fix column type detection while loading fixtures. Closes #7987 [roderickvd]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6798 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-21 18:54:51 +00:00
Jeremy Kemper
5b414190d0 Document deep eager includes. Closes #6267.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6790 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-19 22:36:36 +00:00
Jeremy Kemper
7288fd3e3f Docs: warn that associations names shouldn't be reserved words. Closes #4378.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6770 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-18 19:18:01 +00:00
Jeremy Kemper
e48b062eed Sanitize Base#inspect. Closes #8392.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6761 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-18 02:11:43 +00:00
Michael Koziarski
ebbe4fb0d4 Replace the transaction {|transaction|..} semantics with a new Exception ActiveRecord::Rollback. Closes #8030 [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6754 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-18 01:02:08 +00:00
Jeremy Kemper
9e3a51eb6c Oracle: extract column length for CHAR also. Closes #7866.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6738 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-15 19:30:19 +00:00
David Heinemeier Hansson
e105e599e7 Sexy dumper now has its groove on (closes #8281) [Chris Wanstrath]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-11 21:26:53 +00:00
Marcel Molina
ca3e89d4de Document :allow_nil option for validates_acceptance_of since it defaults to true. Closes #8050. [tzaharia]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6687 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 05:16:41 +00:00
Marcel Molina
6ad9d1dbde Update documentation for :dependent declaration so that it explicitly uses the non-deprecated API. Closes #8069. [danger]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6686 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 05:14:37 +00:00
Marcel Molina
ee614d6319 Add documentation caveat about when to use count_by_sql. Closes #8090. [fearoffish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6685 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 05:10:19 +00:00
Marcel Molina
15dc567e0f Also add documentation enhancements for increment_counter. Closes #8092. [fearoffish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6684 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 05:08:05 +00:00
Marcel Molina
5bd35705ca Enhance documentation for decrement_counter. Closes #8093. [fearoffish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6683 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 05:06:26 +00:00
Marcel Molina
194b4aa4f3 Provide brief introduction to what optimistic locking is. Closes #8097. [fearoffish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6682 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 05:01:31 +00:00
Marcel Molina
6bdcc0cfaf Add documentation for :encoding option to mysql adapter. Closes #8219 [marclove]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6678 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 04:41:45 +00:00
David Heinemeier Hansson
4cbbebb1c3 Added short-hand declaration style to migrations (inspiration from Sexy Migrations, http://errtheblog.com/post/2381) [DHH] Updated resource_scaffold and model generators to use short-hand style migrations [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6667 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 01:48:19 +00:00
Michael Koziarski
0c960602fe Change Base#to_xml to take the name for a container element for an association from the element name, not the first record's class name. Closes #7004
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6654 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-03 02:24:50 +00:00
Michael Koziarski
9d08a07c48 Improve Performance of calling create on has_many :through associations by avoiding loading the target collection. Closes #8150 [evan]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6581 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-26 00:18:38 +00:00
David Heinemeier Hansson
57352f86d4 Improved performance by relying less on exception raising #8159 [Blaine]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-24 16:58:24 +00:00
David Heinemeier Hansson
52a9e5089c Added ActiveRecord::Base.inspect to return a column-view like #<Post id:integer, title:string, body:text> [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6549 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-21 17:35:09 +00:00
David Heinemeier Hansson
c2f4681ab4 Added yielding of Builder instance for ActiveRecord::Base#to_xml calls [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6519 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-13 01:26:17 +00:00
Rick Olson
2a305949d7 documentation project patches, closes #7342, #7319, #7316, #7190 [jeremymcanally]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6470 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-27 14:04:06 +00:00
Rick Olson
4b78a2a245 Add helpful debugging info to the ActiveRecord::StatementInvalid exception in ActiveRecord::ConnectionAdapters::SqliteAdapter#table_structure. Closes #7925. [court3nay]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6469 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-27 06:57:53 +00:00
Jeremy Kemper
b5e01f3e4a SQLite: binary escaping works with ='u'. Closes #7862.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6449 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-19 12:49:23 +00:00
Jeremy Kemper
27ba5edef1 Hash#to_xml supports YAML attributes; ActiveRecord::Base#to_xml support serialized attributes. Closes #7502.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6444 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-18 07:30:09 +00:00