Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update ProductType.rebuild_ancestry to work with mysql2 #1

Merged
merged 2 commits into from

2 participants

@yob
yob commented

This one line fix lets ProductType.rebuild_ancestry work with mysql2 and rails3

@mdub mdub merged commit c337a02 into from
@mdub
Owner

Thanks James. I've released 0.1.2, with your change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 4, 2011
  1. @yob
  2. @yob

    Update gemspec to work without any external files

    yob authored
    * Lets me add the gem to my Gemfile via :git
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 4 deletions.
  1. +1 −3 arboreal.gemspec
  2. +1 −1  lib/arboreal/class_methods.rb
View
4 arboreal.gemspec
@@ -8,11 +8,9 @@ Arboreal surfaces relationships within the tree like "children", "ancestors", "d
as scopes, so that additional filtering/pagination can be performed.
TEXT
-require 'lib/arboreal/version'
-
Gem::Specification.new do |s|
s.name = "arboreal"
- s.version = Arboreal::VERSION.dup
+ s.version = "0.1.1"
s.platform = Gem::Platform::RUBY
s.required_ruby_version = ">= 1.8.7"
s.summary = "Efficient tree structures for ActiveRecord"
View
2  lib/arboreal/class_methods.rb
@@ -32,7 +32,7 @@ def extend_ancestry_strings
# As a result, this *may* not work for DBMS that aren't explicitly supported.
#
def ancestry_extension_sql
- sql = if connection.adapter_name == "MySQL"
+ sql = if connection.adapter_name =~ /mysql/i
<<-SQL
UPDATE _arboreals_ AS child
JOIN _arboreals_ AS parent ON parent.id = child.parent_id
Something went wrong with that request. Please try again.