summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2010-07-23 07:04:25 +0000
committerHans de Graaff <graaff@gentoo.org>2010-07-23 07:04:25 +0000
commit87920f8788ed45d1f5e36e4e8a4d04da8c0226fc (patch)
treed8f273cf9f21dd8b87e56d0c1b37c7e6ed649daf /dev-ruby/activerecord
parentBump -5.11 development version (diff)
downloadgentoo-2-87920f8788ed45d1f5e36e4e8a4d04da8c0226fc.tar.gz
gentoo-2-87920f8788ed45d1f5e36e4e8a4d04da8c0226fc.tar.bz2
gentoo-2-87920f8788ed45d1f5e36e4e8a4d04da8c0226fc.zip
Fix add_index regression as reported in bug 329435 by matsuu.
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/activerecord')
-rw-r--r--dev-ruby/activerecord/ChangeLog9
-rw-r--r--dev-ruby/activerecord/activerecord-2.3.8-r1.ebuild54
-rw-r--r--dev-ruby/activerecord/files/activerecord-2.3.8-add-index-with-symbol.patch55
3 files changed, 117 insertions, 1 deletions
diff --git a/dev-ruby/activerecord/ChangeLog b/dev-ruby/activerecord/ChangeLog
index e706221f9a92..84deed7d6e79 100644
--- a/dev-ruby/activerecord/ChangeLog
+++ b/dev-ruby/activerecord/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-ruby/activerecord
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-ruby/activerecord/ChangeLog,v 1.135 2010/05/31 06:07:54 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/activerecord/ChangeLog,v 1.136 2010/07/23 07:04:25 graaff Exp $
+
+*activerecord-2.3.8-r1 (23 Jul 2010)
+
+ 23 Jul 2010; Hans de Graaff <graaff@gentoo.org>
+ +activerecord-2.3.8-r1.ebuild,
+ +files/activerecord-2.3.8-add-index-with-symbol.patch:
+ Fix add_index regression as reported in bug 329435 by matsuu.
*activerecord-2.3.8 (31 May 2010)
diff --git a/dev-ruby/activerecord/activerecord-2.3.8-r1.ebuild b/dev-ruby/activerecord/activerecord-2.3.8-r1.ebuild
new file mode 100644
index 000000000000..e15246cc1cb3
--- /dev/null
+++ b/dev-ruby/activerecord/activerecord-2.3.8-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/activerecord/activerecord-2.3.8-r1.ebuild,v 1.1 2010/07/23 07:04:25 graaff Exp $
+
+EAPI=2
+USE_RUBY="ruby18 ree18 jruby"
+
+# this is not null so that the dependencies will actually be filled
+RUBY_FAKEGEM_TASK_TEST="none"
+
+RUBY_FAKEGEM_DOCDIR="doc"
+RUBY_FAKEGEM_EXTRADOC="CHANGELOG README"
+
+inherit ruby-fakegem
+
+DESCRIPTION="Implements the ActiveRecord pattern (Fowler, PoEAA) for ORM"
+HOMEPAGE="http://rubyforge.org/projects/activerecord/"
+
+LICENSE="MIT"
+SLOT="2.3"
+KEYWORDS="~amd64 ~ia64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x64-solaris ~x86-solaris"
+IUSE="mysql postgres sqlite3" #sqlite
+
+ruby_add_rdepend "~dev-ruby/activesupport-${PV}"
+
+#ruby_add_rdepend sqlite ">=dev-ruby/sqlite-ruby-2.2.2"
+USE_RUBY=ruby18 ruby_add_rdepend "ruby_targets_ruby18 sqlite3" "dev-ruby/sqlite3-ruby"
+USE_RUBY=ruby18 ruby_add_rdepend "ruby_targets_ruby18 mysql" ">=dev-ruby/mysql-ruby-2.7"
+USE_RUBY=ruby18 ruby_add_rdepend "ruby_targets_ruby18 postgres" "dev-ruby/pg"
+
+ruby_add_bdepend test ">=dev-ruby/mocha-0.9.5 virtual/ruby-test-unit"
+
+all_ruby_prepare() {
+ # Custom template not found in package
+ sed -i -e '/horo/d' Rakefile || die
+
+ epatch "${FILESDIR}/${P}-add-index-with-symbol.patch"
+}
+
+each_ruby_test() {
+ case ${RUBY} in
+ *jruby)
+ ;;
+ *)
+ if use sqlite3; then
+ ${RUBY} -S rake test_sqlite3 || die "sqlite3 tests failed"
+ fi
+ ;;
+ esac
+#
+# if use sqlite; then
+# ${RUBY} -S rake test_sqlite || die "sqlite3 tests failed"
+# fi
+}
diff --git a/dev-ruby/activerecord/files/activerecord-2.3.8-add-index-with-symbol.patch b/dev-ruby/activerecord/files/activerecord-2.3.8-add-index-with-symbol.patch
new file mode 100644
index 000000000000..a35f09fdf4ae
--- /dev/null
+++ b/dev-ruby/activerecord/files/activerecord-2.3.8-add-index-with-symbol.patch
@@ -0,0 +1,55 @@
+Fix for gentoo bug 329435 as reported in
+https://rails.lighthouseapp.com/projects/8994/tickets/4891-rails-238-dbmigrate-gives-undefined-method-length-for-any_indexsymbol
+
+From 1ceabd624b8bc8c68ac98d951160aaff299d18a6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=89tienne=20Barri=C3=A9?= <etienne.barrie@gmail.com>
+Date: Fri, 18 Jun 2010 16:07:17 +0200
+Subject: [PATCH] Fix add_index with a symbol #4891
+
+---
+ .../abstract/schema_statements.rb | 3 ++-
+ activerecord/test/cases/migration_test.rb | 7 +++++++
+ 2 files changed, 9 insertions(+), 1 deletions(-)
+
+diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+index 4fa5881..ddac1f7 100644
+--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
++++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+@@ -273,7 +273,7 @@ module ActiveRecord
+
+ if Hash === options # legacy support, since this param was a string
+ index_type = options[:unique] ? "UNIQUE" : ""
+- index_name = options[:name] || index_name
++ index_name = options[:name].to_s if options[:name]
+ else
+ index_type = options
+ end
+@@ -346,6 +346,7 @@ module ActiveRecord
+ # as there's no way to determine the correct answer in that case.
+ def index_exists?(table_name, index_name, default)
+ return default unless respond_to?(:indexes)
++ index_name = index_name.to_s
+ indexes(table_name).detect { |i| i.name == index_name }
+ end
+
+diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
+index 8517fe2..4b10062 100644
+--- a/activerecord/test/cases/migration_test.rb
++++ b/activerecord/test/cases/migration_test.rb
+@@ -119,6 +119,13 @@ if ActiveRecord::Base.connection.supports_migrations?
+ end
+ end
+
++ def test_index_symbol_names
++ assert_nothing_raised { Person.connection.add_index :people, :primary_contact_id, :name => :symbol_index_name }
++ assert Person.connection.index_exists?(:people, :symbol_index_name, true)
++ assert_nothing_raised { Person.connection.remove_index :people, :name => :symbol_index_name }
++ assert_equal true, !Person.connection.index_exists?(:people, :symbol_index_name, false)
++ end
++
+ def test_add_index_length_limit
+ good_index_name = 'x' * Person.connection.index_name_length
+ too_long_index_name = good_index_name + 'x'
+--
+1.7.1
+