aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-01-03 23:00:44 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-01-03 23:00:44 +0000
commitd9e900cd9dfb408f0a3987bdf63b036f24be0b4d (patch)
treedfb380a2dfa7c8ded27400211999013f2032a618 /activerecord
parentb3739fca2c185831c97efdd9fdcaa23476863539 (diff)
downloadrails-d9e900cd9dfb408f0a3987bdf63b036f24be0b4d.tar.gz
rails-d9e900cd9dfb408f0a3987bdf63b036f24be0b4d.tar.bz2
rails-d9e900cd9dfb408f0a3987bdf63b036f24be0b4d.zip
Fixed the last details to please DB2
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@324 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/has_many_association.rb2
-rw-r--r--activerecord/test/binary_test.rb8
-rw-r--r--activerecord/test/fixtures/db_definitions/db2.sql4
3 files changed, 10 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_association.rb b/activerecord/lib/active_record/associations/has_many_association.rb
index 384433e29a..795eddd511 100644
--- a/activerecord/lib/active_record/associations/has_many_association.rb
+++ b/activerecord/lib/active_record/associations/has_many_association.rb
@@ -85,7 +85,7 @@ module ActiveRecord
# Otherwise, delegate to association class with conditions.
else
- args << { :conditions => "#{@association_class_primary_key_name} = '#{@owner.id}' #{@conditions ? " AND " + @conditions : ""}" }
+ args << { :conditions => "#{@association_class_primary_key_name} = #{@owner.quoted_id} #{@conditions ? " AND " + @conditions : ""}" }
@association_class.find(*args)
end
end
diff --git a/activerecord/test/binary_test.rb b/activerecord/test/binary_test.rb
index b63fbbaede..1e74b023bf 100644
--- a/activerecord/test/binary_test.rb
+++ b/activerecord/test/binary_test.rb
@@ -7,6 +7,12 @@ class BinaryTest < Test::Unit::TestCase
end
def test_load_save
+ # Without using prepared statements, it makes no sense to test
+ # BLOB data with DB2, because the length of a statement is
+ # limited to 32KB.
+ if ActiveRecord::ConnectionAdapters.const_defined? :DB2Adapter
+ return true if ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::DB2Adapter)
+ end
bin = Binary.new
bin.data = @data
@@ -34,4 +40,4 @@ class BinaryTest < Test::Unit::TestCase
File.new(File.dirname(__FILE__)+"/fixtures/associations.png","rb").read
end
-end \ No newline at end of file
+end
diff --git a/activerecord/test/fixtures/db_definitions/db2.sql b/activerecord/test/fixtures/db_definitions/db2.sql
index 9361cd5607..7b98f2fa5a 100644
--- a/activerecord/test/fixtures/db_definitions/db2.sql
+++ b/activerecord/test/fixtures/db_definitions/db2.sql
@@ -119,6 +119,6 @@ CREATE TABLE people (
CREATE TABLE binaries (
id int generated by default as identity (start with +10000),
- data mediumblob,
+ data blob(50000),
PRIMARY KEY (id)
-); \ No newline at end of file
+);