Commit Graph

746 Commits

Author SHA1 Message Date
Jeremy Kemper
0da426be96 Add records to has_many :through using <<, push, and concat by creating the association record. Raise if base or associate are new records since both ids are required to create the association. #build raises since you can't associate an unsaved record. #create! takes an attributes hash and creates the associated record and its association in a transaction.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4786 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-18 07:35:07 +00:00
Jeremy Kemper
18057d2fb6 Cache nil results for :included has_one associations also. Closes #5787.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4783 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-17 23:46:55 +00:00
Tobias Lütke
ae74e8e9fe Fixed a bug which would cause .save to fail after trying to access a empty has_one association on a unsaved record.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4773 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-16 16:05:48 +00:00
Jeremy Kemper
14101c7b40 Nested classes are given table names prefixed by the singular form of the parent's table name.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4770 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-16 09:46:43 +00:00
Jeremy Kemper
79542f8d0b Migrations: uniquely name multicolumn indexes so you don't have to.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4767 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-15 23:05:01 +00:00
Jeremy Kemper
d7f780e066 Fix for deep includes on the same association.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4758 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-14 07:19:47 +00:00
Rick Olson
02021d89b1 Tweak fixtures so they don't try to use a non-ActiveRecord class. [Kevin Clark]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4752 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-11 23:38:46 +00:00
Rick Olson
69266a063b Remove ActiveRecord::Base.reset since Dispatcher doesn't use it anymore. [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4743 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-09 16:54:36 +00:00
Marcel Molina
d3cf2a6689 Document find's :from option. Closes #5762. [andrew@redlinesoftware.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4739 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-09 15:11:18 +00:00
Jeremy Kemper
d568fb6137 PostgreSQL: autodetected sequences work correctly with multiple schemas. Rely on the schema search_path instead of explicitly qualifying the sequence name with its schema. Closes #5280.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4737 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-09 03:25:39 +00:00
Nicholas Seckar
74165eb6ac New dependencies implementation
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4728 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-08 21:21:04 +00:00
Rick Olson
94a1309194 Cache nil results for has_one associations so multiple calls don't call the database. Closes #5757. [Michael A. Schoen]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4721 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-08 16:59:06 +00:00
Marcel Molina
883c54a317 Add documentation for how to disable timestamps on a per model basis. Closes #5684. [matt@mattmargolis.net Marcel Molina Jr.]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4706 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-07 06:54:22 +00:00
Jeremy Kemper
35670bbde5 Don't save has_one associations unnecessarily. Closes #5735.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4690 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-06 19:23:40 +00:00
Rick Olson
e8f0b1ddd9 Refactor ActiveRecord::Base.reset_subclasses to #reset, and add global observer resetting. [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4683 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-06 02:08:29 +00:00
Michael Koziarski
a7f1586404 Formally deprecate the deprecated finders. [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4682 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-05 23:00:34 +00:00
Michael Koziarski
6ba4f4c524 Formally deprecate rich associations. [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4680 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-05 22:35:58 +00:00
David Heinemeier Hansson
c99df461f4 Fixed that default timezones for new / initialize should uphold utc setting (closes #5709) [daniluk@yahoo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4670 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-05 20:50:26 +00:00
Jeremy Kemper
604eb8ab95 Fix announcement of very long migration names. Closes #5722.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4663 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-05 01:39:57 +00:00
Jeremy Kemper
58ebf302b2 The exists? class method should treat a string argument as an id rather than as conditions. Closes #5698.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4655 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-03 22:06:33 +00:00
David Heinemeier Hansson
b5c2366569 Fixed to_xml with :include misbehaviors when invoked on array of model instances (closes #5690) [alexkwolfe@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4652 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-03 17:19:45 +00:00
David Heinemeier Hansson
8085cbfd08 Added support for conditions on Base.exists? (closes #5689) [josh@joshpeek.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4651 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-03 17:16:43 +00:00
Jeremy Kemper
29ae3e9098 Schema dumper quotes date :default values.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4650 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-08-02 20:20:38 +00:00
Rick Olson
ab0277f220 Calculate sum with SQL, not Enumerable on HasManyThrough Associations. [Dan Peterson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4640 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-31 21:06:19 +00:00
Jeremy Kemper
2b3cc2478f r4854@ks: jeremy | 2006-07-30 00:59:18 -0700
Attribute methods
 r4877@ks:  jeremy | 2006-07-30 20:23:53 -0700
 Factor the attribute#{suffix} methods out of method_missing for easier extension.
 r4878@ks:  jeremy | 2006-07-30 20:42:23 -0700
 More specific method naming, declare many attribute method suffixes, set up default suffixes at module include rather than lazily.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4632 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-31 03:43:03 +00:00
Jamis Buck
99e9faeda8 Patch sql injection vulnerability when using integer or float columns.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4626 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-27 18:29:49 +00:00
Rick Olson
971e03f24e Allow #count through a has_many association to accept :include. [Dan Peterson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4618 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-24 04:55:16 +00:00
Jeremy Kemper
35f7cc23ba create_table rdoc: suggest :id => false for habtm join tables
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4606 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-10 21:08:40 +00:00
Jeremy Kemper
ac68115205 PostgreSQL: return array fields as strings. Closes #4664.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4605 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-10 19:54:21 +00:00
Jeremy Kemper
5ad4f1ad94 SQLServer: added tests to ensure all database statements are closed, refactored identity_insert management code to use blocks, removed update/delete rowcount code out of execute and into update/delete, changed insert to go through execute method, removed unused quoting methods, disabled pessimistic locking tests as feature is currently unsupported, fixed RakeFile to load sqlserver specific tests whether running in ado or odbc mode, fixed support for recently added decimal types, added support for limits on integer types. Closes #5670.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4601 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-10 18:24:35 +00:00
Jeremy Kemper
0293c34459 Oracle: BigDecimal support. Closes #5667.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4600 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-10 18:10:50 +00:00
Jeremy Kemper
2a12b56841 r4704@asus: jeremy | 2006-06-27 12:00:19 -0700
decimal
 r4705@asus:  jeremy | 2006-06-27 12:20:47 -0700
 current_adapter? checks whether any of its arguments is the name of the current adapter class
 r4834@asus:  jeremy | 2006-07-08 13:08:24 -0700
 Room to float.
 r4835@asus:  jeremy | 2006-07-08 13:09:18 -0700
 Give lock test a few chances.
 r4836@asus:  jeremy | 2006-07-08 13:12:05 -0700
 Numeric and decimal columns map to BigDecimal instead of Float. Those with scale 0 map to Integer. Closes #5454.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-08 20:35:56 +00:00
Jeremy Kemper
a3f459eecf Firebird migrations support. Closes #5337.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4594 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-08 17:13:21 +00:00
Jeremy Kemper
de5b7370dd PostgreSQL: create/drop as postgres user. Closes #4790.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4588 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-08 01:28:53 +00:00
Jeremy Kemper
80b5331c0f Rollback [4584], bad test. Reopens #3819.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4586 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-08 01:09:23 +00:00
Jeremy Kemper
1060fe2d72 Update callbacks documentation. Closes #3970.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4585 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-08 00:52:37 +00:00
Jeremy Kemper
7767e33b43 Don't modify options parameters in-place. Closes #3819.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4584 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-08 00:38:06 +00:00
Jeremy Kemper
3080b273a8 PostgreSQL: correctly quote the ' in pk_and_sequence_for. Closes #5462.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4580 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-07 21:19:27 +00:00
Jeremy Kemper
c4233a0eae PostgreSQL: correctly quote microseconds in timestamps. Closes #5641.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4579 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-07 17:40:22 +00:00
Jeremy Kemper
69d8ca4c52 Clearer has_one/belongs_to model names (account has_one :user). Closes #5632.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4577 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-07 10:58:22 +00:00
Jeremy Kemper
40bdbba48d Oracle: use nonblocking queries if allow_concurrency is set, fix pessimistic locking, don't guess date vs. time by default (set OracleAdapter.emulate_dates = true for the old behavior), adapter cleanup. Closes #5635.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4574 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-07 10:42:14 +00:00
David Heinemeier Hansson
784165e03b Fixed a few Oracle issues: Allows Oracle's odd date handling to still work consistently within #to_xml, Passes test that hardcode insert statement by dropping the :id column, Updated RUNNING_UNIT_TESTS with Oracle instructions, Corrects method signature for #exec #5294 [schoenm@earthlink.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4552 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-05 02:54:19 +00:00
David Heinemeier Hansson
750ca7998b Added :group to available options for finds done on associations (closes #5516) [mike@michaeldewey.org]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4544 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-05 01:48:09 +00:00
Nicholas Seckar
66313f77ca Minor tweak to improve performance of ActiveRecord::Base#to_param
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4531 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-07-03 03:57:31 +00:00
Jeremy Kemper
6a1a1e5536 r4738@asus: jeremy | 2006-06-29 20:18:43 -0700
Observers also watch subclasses created after they are declared. Closes #5535.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4521 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-30 04:38:24 +00:00
Jeremy Kemper
5fe64dd1a6 r4724@asus: jeremy | 2006-06-28 19:22:46 -0700
Removed deprecated timestamps_gmt class methods.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4511 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-29 02:39:32 +00:00
Jeremy Kemper
a092749554 rake build_mysql_database grants permissions to rails@localhost. Closes #5501.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4503 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-28 23:36:22 +00:00
Jeremy Kemper
42775686d2 PostgreSQL: support microsecond time resolution. Closes #5492.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4494 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-25 18:04:06 +00:00
Nicholas Seckar
d9125093e8 Add AssociationCollection#sum since the method_missing invokation has been shadowed by Enumerable#sum. Closes #5500.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4493 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-25 17:49:24 +00:00
Sam Stephenson
d19e46421c Added find_or_initialize_by_X which works like find_or_create_by_X but doesn't save the newly instantiated record
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4473 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-20 22:48:52 +00:00
Jeremy Kemper
b5d264effa r4667@asus: jeremy | 2006-06-20 00:59:15 -0700
tpyo


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4463 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-20 07:59:36 +00:00
Jeremy Kemper
722e0b6a8b r4664@asus: jeremy | 2006-06-19 18:55:36 -0700
Use the #lock method to obtain a row lock on a single record. Simply reloads the record with :lock => true.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4462 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-20 01:58:36 +00:00
Jeremy Kemper
15aa6e0552 r4644@asus: jeremy | 2006-06-16 14:57:03 -0700
locking
 r4645@asus:  jeremy | 2006-06-17 12:41:30 -0700
 missing reply fixture
 r4646@asus:  jeremy | 2006-06-19 13:05:23 -0700
 Use a per-thread (rather than global) transaction mutex so you may execute concurrent transactions on separate connections.
 r4647@asus:  jeremy | 2006-06-19 13:07:23 -0700
 PostgreSQL: introduce allow_concurrency option which determines whether to use blocking or asynchronous #execute. Adapters with blocking #execute will deadlock Ruby threads. The default value is ActiveRecord::Base.allow_concurrency.
 r4648@asus:  jeremy | 2006-06-19 13:08:40 -0700
 Pass the default allow_concurrency when instantiating new connections.
 r4649@asus:  jeremy | 2006-06-19 13:11:12 -0700
 Break out concurrent transaction tests and run them for PostgreSQLAdapter only (need to fork or system('some_test_script') for the other adapters)
 r4650@asus:  jeremy | 2006-06-19 13:42:48 -0700
 Row locking. Provide a locking clause with the :lock finder option or true for the default "FOR UPDATE".
 r4661@asus:  jeremy | 2006-06-19 15:36:51 -0700
 excise the junk mutex


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4460 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-19 22:48:51 +00:00
Nicholas Seckar
e5fc5aaffe Change AR::Base#to_param to return a String instead of a Fixnum. Closes #5320.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4459 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-19 16:45:34 +00:00
Jamis Buck
f97978ad91 Use explicit delegation instead of method aliasing for AR::Base.to_param -> AR::Base.id. (closes #5299)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4437 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-05 15:41:24 +00:00
David Heinemeier Hansson
2e65e8ccc6 Refactored ActiveRecord::Base.to_xml to become a delegate for XmlSerializer, which restores sanity to the mega method. This refactoring also reinstates the opinions that type="string" is redundant and ugly and nil-differentiation is not a concern of serialization [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4431 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-04 00:33:52 +00:00
David Heinemeier Hansson
c5ec16e583 Added simple hash conditions to find that'll just convert hash to an AND-based condition string (closes #5143) [hcatlin@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4425 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-03 22:15:06 +00:00
David Heinemeier Hansson
cb62f06dcf Fixed issues with BLOB limits, charsets, and booleans for Firebird (closes #5194, #5191, #5189) [kennethkunz@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4424 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-03 21:57:03 +00:00
David Heinemeier Hansson
d016d9a6d4 Fixed usage of :limit and with_scope when the association in scope is a 1:m (closes #5208) [alex@purefiction.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4422 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-03 21:51:57 +00:00
David Heinemeier Hansson
7f00f51239 Fixed migration trouble with SQLite when NOT NULL is used in the new definition (closes #5215) [greg@lapcominc.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4419 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-03 21:41:40 +00:00
David Heinemeier Hansson
3e67e0b3b2 Fixed problems with eager loading and counting on SQL Server (closed #5212) [kajism@yahoo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4418 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-03 21:27:16 +00:00
David Heinemeier Hansson
4394e402b7 Fixed that count distinct should use the selected column even when using :include (closes #5251) [anna@wota.jp]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4417 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-03 21:19:36 +00:00
David Heinemeier Hansson
01a52dd1ad Fixed that :includes merged from with_scope won't cause the same association to be loaded more than once if repetition occurs in the clauses (closes #5253) [alex@purefiction.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4415 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-03 21:11:48 +00:00
Jeremy Kemper
48052d70ec to_xml fixes, features, and speedup. Closes #4989.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4413 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-03 00:01:08 +00:00
Jeremy Kemper
6aaa08d85b PostgreSQL: don't ignore port when host is nil since it's often used to label the domain socket. Closes #5247.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4401 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-02 01:25:11 +00:00
Jeremy Kemper
b09d02c9e8 Records and arrays of records are bound as quoted ids.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4391 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-01 01:43:20 +00:00
David Heinemeier Hansson
9fcc0654c3 Fixed that Base.find :all, :conditions => [ "id IN (?)", collection ] would fail if collection was empty [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4390 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-06-01 00:43:02 +00:00
Rick Olson
05a17dc6b5 Add a list of regexes assert_queries skips in the ActiveRecord test suite. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4385 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-31 20:47:03 +00:00
Rick Olson
06075a9eb5 Fix the has_and_belongs_to_many #create doesn't populate the join for new records. Closes #3692 [josh@hasmanythrough.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4379 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-29 03:48:17 +00:00
Rick Olson
ea51d72edb Provide Association Extensions access to the instance that the association is being accessed from. Closes #4433 [josh@hasmanythrough.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4372 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-28 21:33:34 +00:00
Marcel Molina
c9ef5ac7c7 Update OpenBase adaterp's maintainer's email address. Closes #5176. [Derrick Spell]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4366 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-24 17:20:51 +00:00
Rick Olson
0b41d088dc Add a quick note about :select and eagerly included associations. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4363 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-23 14:16:52 +00:00
Rick Olson
213992195d Add docs for the :as option in has_one associations. Closes #5144 [cdcarter@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4358 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-22 08:00:05 +00:00
David Heinemeier Hansson
66586bc168 Fixed that has_many collections shouldn't load the entire association to do build or create [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4354 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-21 19:17:37 +00:00
David Heinemeier Hansson
59c8c63ecd Added :allow_nil option for aggregations (closes #5091) [ian.w.white@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4353 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-21 17:32:37 +00:00
Marcel Molina
d22f9c9488 Fix Oracle boolean support and tests. Closes #5139. [schoenm@earthlink.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4351 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-21 15:13:28 +00:00
Jeremy Kemper
c50113bc61 create! no longer blows up when no attributes are passed and a :create scope is in effect (e.g. foo.bars.create! failed whereas foo.bars.create!({}) didn't.)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4348 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-19 01:05:20 +00:00
Rick Olson
be3a4849a9 Call Inflector#demodulize on the class name when eagerly including an STI model. Closes #5077 [info@loobmedia.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4342 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-15 14:08:51 +00:00
Marcel Molina
9c5591da2d Preserve MySQL boolean column defaults when changing a column in a migration. Closes #5015. [pdcawley@bofh.org.uk]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4340 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-14 18:37:22 +00:00
Jeremy Kemper
491b4a3c84 PostgreSQL: migrations support :limit with :integer columns by mapping limit < 4 to smallint, > 4 to bigint, and anything else to integer. Closes #2900.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4335 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-12 03:59:43 +00:00
Jeremy Kemper
d08d89c092 Dates and times interpret empty strings as nil rather than 2000-01-01. Closes #4830.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4327 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-07 07:52:08 +00:00
Jeremy Kemper
50f538b72b Allow :uniq => true with has_many :through associations.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4325 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-05-06 23:37:56 +00:00
Marcel Molina
68ab908716 Ensure that StringIO is always available for the Schema dumper. [Marcel Molina Jr.]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-30 02:40:06 +00:00
Marcel Molina
3fec943aca Allow AR::Base#to_xml to include methods too. Closes #4921. [johan@textdrive.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4314 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-29 23:00:47 +00:00
Marcel Molina
aa72c465ec Replace superfluous name_to_class_name variant with camelize. [Marcel Molina Jr.]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4313 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-29 20:34:31 +00:00
Marcel Molina
9f92dd3984 Replace alias method chaining with Module#alias_method_chain. [Marcel Molina Jr.]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4312 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-29 20:20:22 +00:00
Marcel Molina
6186490962 Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4310 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-29 18:10:14 +00:00
Marcel Molina
f42403ff49 Remove duplicate fixture entry in comments.yml. Closes #4923. [Blair Zajac <blair@orcaware.com>]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4305 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-29 05:02:54 +00:00
Marcel Molina
f26e9b6861 Update FrontBase adapter to check binding version. Closes #4920. [mlaster@metavillage.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4304 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-28 20:04:47 +00:00
Marcel Molina
bb875172e2 New Frontbase connections don't start in auto-commit mode. Closes #4922. [mlaster@metavillage.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4302 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-28 19:43:41 +00:00
Marcel Molina
0dc53a8f6f When grouping, use the appropriate option key. [Marcel Molina Jr.]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4297 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-28 01:12:18 +00:00
Marcel Molina
2ec1527c47 Only modify the sequence name in the FrontBase adapter if the FrontBase adapter is actually being used. [Marcel Molina Jr.]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4296 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-28 00:56:15 +00:00
Marcel Molina
b2c0ddf033 Add support for FrontBase (http://www.frontbase.com/) with a new adapter thanks to the hard work of one Mike Laster. Closes #4093. [mlaster@metavillage.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4291 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-27 22:39:45 +00:00
Marcel Molina
3ba7c53b5a Add warning about the proper way to validate the presence of a foreign key. Closes #4147. [Francois Beausoleil <francois.beausoleil@gmail.com>]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4285 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-26 22:06:28 +00:00
Marcel Molina
ca2eb16bf9 Fix syntax error in documentation. Closes #4679. [mislav@nippur.irb.hr]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4281 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-26 21:29:10 +00:00
Marcel Molina
242cd0604e Add Oracle support for CLOB inserts. Closes #4748. [schoenm@earthlink.net sandra.metz@duke.edu]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4280 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-26 20:43:29 +00:00
Marcel Molina
8df0dad4ac Various fixes for sqlserver_adapter (odbc statement finishing, ado schema dumper, drop index). Closes #4831. [kajism@yahoo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4279 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-26 19:52:13 +00:00
Marcel Molina
91531372f9 Add support for :order option to with_scope. Closes #3887. [eric.daspet@survol.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4274 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-26 06:37:04 +00:00
Marcel Molina
f274a89f8b Prettify output of schema_dumper by making things line up. Closes #4241 [Caio Chassot <caio@v2studio.com>]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4273 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-26 06:15:51 +00:00
Marcel Molina
7a01561a6e Make build_postgresql_databases task make databases owned by the postgres user. Closes #4790. [mlaster@metavillage.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4271 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-04-25 19:20:00 +00:00