Skip to content

Commit

Permalink
fixed up code to run on 1.9.3 and 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoss committed Jun 12, 2014
1 parent 7dc8def commit 0bcb399
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -3,7 +3,7 @@ source 'https://rubygems.org'
gem 'activerecord', '4.1.1'
gem 'rake'
gem 'pg'
gem 'rspec-rails'
gem 'rspec'

group :test, :development do
gem 'database_cleaner'
Expand Down
4 changes: 2 additions & 2 deletions lib/treeify.rb
Expand Up @@ -9,8 +9,8 @@ module Treeify
included do
class_attribute :cols
scope :roots, -> { where(parent_id: nil) }
scope :tree_for, -> (instance) { where("#{table_name}.id IN (#{tree_sql_for(instance)})").order("#{table_name}.id") }
scope :tree_for_ancestors, -> (instance) { where("#{table_name}.id IN (#{tree_sql_for_ancestors(instance)})").order("#{table_name}.id") }
scope :tree_for, ->(instance) { where("#{table_name}.id IN (#{tree_sql_for(instance)})").order("#{table_name}.id") }
scope :tree_for_ancestors, ->(instance) { where("#{table_name}.id IN (#{tree_sql_for_ancestors(instance)})").order("#{table_name}.id") }
end

module ClassMethods
Expand Down
3 changes: 0 additions & 3 deletions spec/treeify_spec.rb
Expand Up @@ -31,15 +31,12 @@

describe "Modifying the tree" do
it "adds a new child" do
pending "fart"
end

it "updates a child" do
pending "fart"
end

it "deletes a child" do
pending "fart"
end
end
end
Expand Down

0 comments on commit 0bcb399

Please sign in to comment.