@@ -8,10 +8,9 env: | |||||
8 | rvm: |
|
8 | rvm: | |
9 | - 2.0.0 |
|
9 | - 2.0.0 | |
10 | - 1.9.3 |
|
10 | - 1.9.3 | |
11 |
- rbx |
|
11 | - rbx | |
12 | - jruby-19mode |
|
12 | - jruby-19mode | |
13 | - 1.8.7 |
|
13 | - 1.8.7 | |
14 | - rbx-18mode |
|
|||
15 | - jruby-18mode |
|
14 | - jruby-18mode | |
16 | gemfile: |
|
15 | gemfile: | |
17 | - gemfiles/Gemfile.rails-3.0.rb |
|
16 | - gemfiles/Gemfile.rails-3.0.rb |
@@ -23,6 +23,12 gem 'railties', RAILS_VERSION | |||||
23 | gem 'activerecord', RAILS_VERSION |
|
23 | gem 'activerecord', RAILS_VERSION | |
24 | gem 'actionpack', RAILS_VERSION |
|
24 | gem 'actionpack', RAILS_VERSION | |
25 |
|
25 | |||
|
26 | platforms :rbx do | |||
|
27 | gem 'rubysl', '~> 2.0' | |||
|
28 | gem 'rubysl-test-unit' | |||
|
29 | end | |||
|
30 | ||||
|
31 | ||||
26 | # Add Oracle Adapters |
|
32 | # Add Oracle Adapters | |
27 | # gem 'ruby-oci8' |
|
33 | # gem 'ruby-oci8' | |
28 | # gem 'activerecord-oracle_enhanced-adapter' |
|
34 | # gem 'activerecord-oracle_enhanced-adapter' |
@@ -92,7 +92,8 module CollectiveIdea #:nodoc: | |||||
92 | :foreign_key => parent_column_name, |
|
92 | :foreign_key => parent_column_name, | |
93 | :counter_cache => acts_as_nested_set_options[:counter_cache], |
|
93 | :counter_cache => acts_as_nested_set_options[:counter_cache], | |
94 | :inverse_of => (:children unless acts_as_nested_set_options[:polymorphic]), |
|
94 | :inverse_of => (:children unless acts_as_nested_set_options[:polymorphic]), | |
95 | :polymorphic => acts_as_nested_set_options[:polymorphic] |
|
95 | :polymorphic => acts_as_nested_set_options[:polymorphic], | |
|
96 | :touch => acts_as_nested_set_options[:touch] | |||
96 | end |
|
97 | end | |
97 |
|
98 | |||
98 | def acts_as_nested_set_default_options |
|
99 | def acts_as_nested_set_default_options | |
@@ -103,7 +104,8 module CollectiveIdea #:nodoc: | |||||
103 | :depth_column => 'depth', |
|
104 | :depth_column => 'depth', | |
104 | :dependent => :delete_all, # or :destroy |
|
105 | :dependent => :delete_all, # or :destroy | |
105 | :polymorphic => false, |
|
106 | :polymorphic => false, | |
106 | :counter_cache => false |
|
107 | :counter_cache => false, | |
|
108 | :touch => false | |||
107 | }.freeze |
|
109 | }.freeze | |
108 | end |
|
110 | end | |
109 |
|
111 |
@@ -23,7 +23,9 module CollectiveIdea | |||||
23 | if acts_as_nested_set_options[:scope] |
|
23 | if acts_as_nested_set_options[:scope] | |
24 | scope = proc {|node| |
|
24 | scope = proc {|node| | |
25 | scope_column_names.inject("") {|str, column_name| |
|
25 | scope_column_names.inject("") {|str, column_name| | |
26 |
|
|
26 | column_value = node.send(column_name) | |
|
27 | cond = column_value.nil? ? "IS NULL" : "= #{connection.quote(column_value)}" | |||
|
28 | str << "AND #{connection.quote_column_name(column_name)} #{cond} " | |||
27 | } |
|
29 | } | |
28 | } |
|
30 | } | |
29 | end |
|
31 | end |
General Comments 0
You need to be logged in to leave comments.
Login now