Commit Graph

1106 Commits

Author SHA1 Message Date
Michael Koziarski
c95f066bf5 Add 'foxy' support for fixtures of polymorphic associations. Closes #10183 [jbarnette, David Lowenfels]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8170 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-20 21:53:22 +00:00
Jeremy Kemper
473202df83 attr_readonly behaves well with optimistic locking. Closes #10188.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-16 20:31:24 +00:00
Jeremy Kemper
ea256eaa7f Base#to_xml supports the nil="true" attribute like Hash#to_xml. Closes #8268.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8138 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-14 10:33:25 +00:00
Marcel Molina
578c7a18e4 Change plings to the more conventional quotes in the documentation. Closes #10104 [danger]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8131 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-12 18:36:42 +00:00
Rick Olson
3104291322 Fix HasManyThrough Association so it uses :conditions on the HasMany Association. Closes #9729 [danger]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8128 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-11 01:03:43 +00:00
Michael Koziarski
79823e0b2f Ensure that column names are quoted. Closes #10134 [wesley.moxam]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8126 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-10 21:33:13 +00:00
David Heinemeier Hansson
b318134c99 Kill the whiny_protected_attributes setting and kill the exception raised. Instead, just log the mass-assignment misalignment as a debug warning (closes #9966)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8120 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-09 19:57:24 +00:00
Marcel Molina
7143d80147 Smattering of grammatical fixes to documentation. Closes #10083 [BobSilva]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8113 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-08 03:37:16 +00:00
Marcel Molina
f770b829f4 Enhance explanation with more examples for attr_accessible macro. Closes #8095 [fearoffish, Marcel Molina]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8107 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-06 23:50:23 +00:00
Marcel Molina
a291ea2bc9 Update association/method mapping table to refected latest collection methods for has_many :through. Closes #8772 [lifofifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8102 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-06 23:20:22 +00:00
Marcel Molina
4f59aacb68 Explain semantics of having several different AR instances in a transaction block. Closes #9036 [jacobat, Marcel Molina]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8096 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-06 19:04:54 +00:00
Marcel Molina
026973f6a0 Update Schema documentation to use updated sexy migration notation. Closes #10086 [sjgman9]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8089 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-06 18:26:54 +00:00
Michael Koziarski
3c9cd19786 Make fixtures work with the new test subclasses. [tarmo, Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8060 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-31 05:43:52 +00:00
Jeremy Kemper
bef071dd0b Introduce finder :joins with associations. Same :include syntax but with inner rather than outer joins. Closes #10012.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8054 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-29 21:39:52 +00:00
Jeremy Kemper
204c2755e2 Associations: speedup duplicate record check. Closes #10011.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8051 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-29 03:02:42 +00:00
Michael Koziarski
df0765d8dc Make sure that << works on has_many associations on unsaved records. Closes #9989 [hasmanyjosh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8049 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-28 03:39:18 +00:00
Jeremy Kemper
88f951a519 Allow association redefinition in subclasses. Closes #9346.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8046 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-27 20:31:09 +00:00
Jeremy Kemper
4b639904d7 Fix has_many :through delete with custom foreign keys. Closes #6466.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8043 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-27 18:51:32 +00:00
Jeremy Kemper
49eafd8c36 Foxy fixtures. Adapter#disable_referential_integrity. Closes #9981.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8036 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-26 05:56:46 +00:00
Marcel Molina
d761ac4095 Add docs explaining how to protect all attributes using attr_accessible with no arguments. Closes #9631 [boone, rmm5t]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8032 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-26 04:07:39 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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