Commit Graph

933 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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