Commit Graph

798 Commits

Author SHA1 Message Date
Jeremy Kemper
28767075f4 Pass a range in :conditions to use the SQL BETWEEN operator. Closes #6974.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5876 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-10 10:13:18 +00:00
Michael Koziarski
b4282df966 Fix the Oracle adapter for serialized attributes stored in CLOBs. Closes #6825 [mschoen, tdfowler]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5866 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-05 23:42:03 +00:00
Rick Olson
1400e7f864 [DOCS] Apply more documentation for ActiveRecord Reflection. Closes #4055 [Robby Russell]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5855 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-05 20:22:41 +00:00
Rick Olson
606376bd44 [DOCS] Document :allow_nil option of #validate_uniqueness_of. Closes #3143 [Caio Chassot]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5853 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-05 20:17:37 +00:00
Michael Koziarski
84481dd3b4 Sybase adapter fixes. Closes #6926 [jsheets]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5839 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-05 00:12:06 +00:00
Rick Olson
1af2022cc3 Rollback #new_record? and #id values for created records that rollback in an after_save callback. Closes #6910 [Ben Curren]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5830 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-02 05:36:30 +00:00
Jeremy Kemper
4cf8bf7312 Pushing a record on an association collection doesn't unnecessarily load all the associated records.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5769 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-21 23:28:12 +00:00
Jeremy Kemper
a8b53f1dbb Oracle: fix connection reset failure. Closes #6846.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5761 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-20 21:14:41 +00:00
Jeremy Kemper
7277c51891 Partially revert [5660] - makes more trouble than it resolves. References #5704, closes #6766.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5753 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-19 19:47:21 +00:00
Jeremy Kemper
8732ce291b Subclass instantiation doesn't try to explicitly require the corresponding subclass. Closes #6840.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5751 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-19 19:23:56 +00:00
Rick Olson
41466a4c83 fix faulty inheritance tests and that eager loading grabs the wrong inheritance column when the class of your association is an STI subclass. Closes #6859 [protocool]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5744 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-19 03:10:39 +00:00
Tobias Lütke
cdad2d41e1 Consolidated different create and create! versions to call through to the base class with scope. This fixes inconsistencies, especially related to protected attribtues.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5684 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-06 00:13:31 +00:00
Jeremy Kemper
8dea60b0c3 find supports :lock with :include. Check whether your database allows SELECT ... FOR UPDATE with outer joins before using. Closes #6764.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5682 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-05 22:07:55 +00:00
Tobias Lütke
0ee0c1b2aa Add AssociationCollection#create! to be consistent with AssociationCollection#create when dealing with a foreign key that is a protected attribute
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5677 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-05 17:55:44 +00:00
David Heinemeier Hansson
22f095be23 Added counter optimization for AssociationCollection#any? so person.friends.any? won't actually load the full association if we have the count in a cheaper form [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5676 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-05 03:26:56 +00:00
Jeremy Kemper
8ffb22056c Subclasses of an abstract class work with single-table inheritance. Closes #5704.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-01 21:24:47 +00:00
Michael Koziarski
a2e826dc0f Change fixture_path to a class inheritable accessor allowing test cases to have their own custom set of fixtures. Closes #6672 [zdennis]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5604 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-21 22:28:24 +00:00
Jeremy Kemper
9104d63f99 Quote ActiveSupport::Multibyte::Chars. Closes #6653.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5597 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 12:02:04 +00:00
Jeremy Kemper
cd6beacfb3 Test for forged '' default before it's typecast. Closes #6156.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 11:44:31 +00:00
Jeremy Kemper
6e1012fc9c Test has_one :dependent => :nullify with missing association. Closes #4848.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5595 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 11:29:21 +00:00
Jeremy Kemper
ced5d89425 Test has_one :dependent => :nullify with missing association. Closes #4828.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5594 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 11:28:35 +00:00
Jeremy Kemper
427fb035a3 Simplify query_attribute by typecasting the attribute value and checking whether it's nil, false, zero or blank. Closes #6659.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5593 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 11:22:38 +00:00
Jeremy Kemper
9594832a8d validates_numericality_of uses \A \Z to ensure the entire string matches rather than ^ $ which may match one valid line of a multiline string. Closes #5716.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5589 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 10:51:50 +00:00
Jeremy Kemper
88bd86e8bc Run validations in the order they were declared. Closes #6657.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5588 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 10:12:38 +00:00
Jeremy Kemper
19c99acfbc MySQL: detect when a NOT NULL column without a default value is misreported as default ''. Can't detect for string, text, and binary columns since '' is a legitimate default. Closes #6156.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5586 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 08:54:42 +00:00
Jeremy Kemper
02adc49d72 Simplify association proxy implementation by factoring construct_scope out of method_missing. Closes #6643.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5564 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-19 11:16:12 +00:00
Jeremy Kemper
be3a4c3daa Mysql::Result#all_hashes compatibility with Mysql C driver 2.6.x. Closes #6601.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5533 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-16 01:41:22 +00:00
Jeremy Kemper
50ee332c4a Cleanup SQLite AUTOINCREMENT: exclude sqlite_sequence table, factor out feature availability check.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5520 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-14 03:32:16 +00:00
Jeremy Kemper
fda4330ce9 Update Oracle performance credits.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5518 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-14 02:49:33 +00:00
Jeremy Kemper
4978d1dce7 Oracle: automatically detect the primary key. Closes #6594.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5514 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-13 19:23:32 +00:00
Jeremy Kemper
a303a168ac Oracle: to increase performance, prefetch 100 rows and enable similar cursor sharing. Both are configurable in database.yml. Closes #6607.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5509 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-13 07:36:52 +00:00
Jeremy Kemper
c0bce43e90 Oracle: fix limited id selection for eager loading. Closes #6515.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5480 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-10 19:18:07 +00:00
Jeremy Kemper
63df6eb382 Don't inspect unloaded associations. Closes #2905.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5478 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-10 02:00:14 +00:00
Jeremy Kemper
d97a84fb59 SQLite: use AUTOINCREMENT primary key in >= 3.1.0. Closes #6588.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-09 21:17:43 +00:00
Jeremy Kemper
9d2da04680 Cache inheritance_column. Closes #6592.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-09 19:31:31 +00:00
Jeremy Kemper
66b92abfc3 Firebird: decimal/numeric support. Closes #6408.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5459 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-07 19:56:01 +00:00
Jamis Buck
57a3e44052 make add_order a tad faster (Closes #6567)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5452 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-07 19:06:35 +00:00
Jeremy Kemper
a3dba1ed7c Find with :include respects scoped :order. Closes #5850.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-07 00:18:07 +00:00
Jeremy Kemper
2fbe0ae7a2 Support nil and Array in :conditions => { attr => value } hashes. Closes #6548.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5435 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-05 21:27:51 +00:00
Jeremy Kemper
5b979ed8ff Consistently use LOWER() for uniqueness validations (rather than mixing with UPPER()) so the database can always use a functional index on the lowercased column. Closes #6495.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-05 19:20:39 +00:00
Jeremy Kemper
b6171e7105 SQLite: count(distinct) queries supported in >= 3.2.6, fix calculations workaround, remove count(distinct) query rewrite, cleanup test connection scripts. Closes #6544.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5426 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-05 02:01:31 +00:00
Jeremy Kemper
c7c3994d31 Dynamically generate reader methods for serialized attributes. Closes #6362.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5416 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-02 20:20:46 +00:00
Jeremy Kemper
88d9b32496 Deprecation: object transactions warning.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5405 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-02 18:12:18 +00:00
Jeremy Kemper
ac715b2bcb has_one :dependent => :nullify ignores nil associates. Closes #6528.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5401 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-02 09:45:17 +00:00
Jeremy Kemper
70840d4b7f Oracle: resolve test failures, use prefetched primary key for inserts, check for null defaults. Factor out some common methods from all adapters. Closes #6515.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5384 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-01 20:28:48 +00:00
Michael Koziarski
53a97e9d61 Make add_column use the options hash with the Sqlite Adapter. Closes #6464 [obrie]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5353 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-24 07:32:18 +00:00
Marcel Molina
fb7807e244 Document other options available to migration's add_column. #6419
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5333 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-22 02:55:21 +00:00
Jeremy Kemper
8949ce0982 MySQL: all_hashes compatibility with old MysqlRes class. Closes #6429.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5330 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-20 20:30:59 +00:00
Rick Olson
c5536f9f00 Fix has_many :through to add the appropriate conditions when going through an association using STI. Closes #5783. [Jonathan Viney] (sorry, forgot to commit the actual files)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5310 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-16 15:42:55 +00:00
Rick Olson
e789b26e65 fix select_limited_ids_list issues in postgresql, retain current behavior in other adapters [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5291 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-13 08:29:00 +00:00