Permalink
Browse files

Fixed Node's counter, and gemfile

  • Loading branch information...
1 parent 71b75d0 commit f5eb571d1967c1cbf13648f5fac6c91caa80704e @epitron committed Mar 28, 2012
Showing with 19 additions and 1 deletion.
  1. +6 −0 Gemfile
  2. +12 −0 Gemfile.lock
  3. +1 −1 app/models/node.rb
View
@@ -2,4 +2,10 @@ source 'http://rubygems.org'
gem 'rails', '~> 2.3'
gem 'haml'
+gem 'sass'
gem 'mysql'
+
+group :development, :test do
+ gem 'test-unit', '1.2.3'
+ gem 'rspec-rails', '~> 1.3'
+end
View
@@ -12,6 +12,8 @@ GEM
activesupport (= 2.3.14)
activesupport (2.3.14)
haml (3.1.3)
+ hoe (3.0.1)
+ rake (~> 0.8)
mysql (2.8.1)
rack (1.1.2)
rails (2.3.14)
@@ -22,6 +24,13 @@ GEM
activesupport (= 2.3.14)
rake (>= 0.8.3)
rake (0.9.2.2)
+ rspec (1.3.2)
+ rspec-rails (1.3.4)
+ rack (>= 1.0.0)
+ rspec (~> 1.3.1)
+ sass (3.1.15)
+ test-unit (1.2.3)
+ hoe (>= 1.5.1)
PLATFORMS
ruby
@@ -30,3 +39,6 @@ DEPENDENCIES
haml
mysql
rails (~> 2.3)
+ rspec-rails (~> 1.3)
+ sass
+ test-unit (= 1.2.3)
View
@@ -24,7 +24,7 @@ class Node < ActiveRecord::Base
include ActionView::Helpers::NumberHelper
- belongs_to :parent, :class_name => "Node", :foreign_key => "parent_id", :counter_cache => :children_counter
+ belongs_to :parent, :class_name => "Node", :foreign_key => "parent_id", :counter_cache => :children_count
has_many :children, :class_name => "Node", :foreign_key => "parent_id", :dependent => :destroy
################################################################################################

0 comments on commit f5eb571

Please sign in to comment.