mirror of
https://github.com/redmine/redmine.git
synced 2025-11-13 16:56:00 +01:00
awesome_nested_set: import git 2-1-stable branch revision 3d5ac746542b564 (#6579)
https://github.com/collectiveidea/awesome_nested_set/commit/3d5ac746542b564 git-svn-id: http://svn.redmine.org/redmine/trunk@13144 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -8,10 +8,9 @@ env:
|
|||||||
rvm:
|
rvm:
|
||||||
- 2.0.0
|
- 2.0.0
|
||||||
- 1.9.3
|
- 1.9.3
|
||||||
- rbx-19mode
|
- rbx
|
||||||
- jruby-19mode
|
- jruby-19mode
|
||||||
- 1.8.7
|
- 1.8.7
|
||||||
- rbx-18mode
|
|
||||||
- jruby-18mode
|
- jruby-18mode
|
||||||
gemfile:
|
gemfile:
|
||||||
- gemfiles/Gemfile.rails-3.0.rb
|
- gemfiles/Gemfile.rails-3.0.rb
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ gem 'railties', RAILS_VERSION
|
|||||||
gem 'activerecord', RAILS_VERSION
|
gem 'activerecord', RAILS_VERSION
|
||||||
gem 'actionpack', RAILS_VERSION
|
gem 'actionpack', RAILS_VERSION
|
||||||
|
|
||||||
|
platforms :rbx do
|
||||||
|
gem 'rubysl', '~> 2.0'
|
||||||
|
gem 'rubysl-test-unit'
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
# Add Oracle Adapters
|
# Add Oracle Adapters
|
||||||
# gem 'ruby-oci8'
|
# gem 'ruby-oci8'
|
||||||
# gem 'activerecord-oracle_enhanced-adapter'
|
# gem 'activerecord-oracle_enhanced-adapter'
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ module CollectiveIdea #:nodoc:
|
|||||||
:foreign_key => parent_column_name,
|
:foreign_key => parent_column_name,
|
||||||
:counter_cache => acts_as_nested_set_options[:counter_cache],
|
:counter_cache => acts_as_nested_set_options[:counter_cache],
|
||||||
:inverse_of => (:children unless acts_as_nested_set_options[:polymorphic]),
|
:inverse_of => (:children unless acts_as_nested_set_options[:polymorphic]),
|
||||||
:polymorphic => acts_as_nested_set_options[:polymorphic]
|
:polymorphic => acts_as_nested_set_options[:polymorphic],
|
||||||
|
:touch => acts_as_nested_set_options[:touch]
|
||||||
end
|
end
|
||||||
|
|
||||||
def acts_as_nested_set_default_options
|
def acts_as_nested_set_default_options
|
||||||
@@ -103,7 +104,8 @@ module CollectiveIdea #:nodoc:
|
|||||||
:depth_column => 'depth',
|
:depth_column => 'depth',
|
||||||
:dependent => :delete_all, # or :destroy
|
:dependent => :delete_all, # or :destroy
|
||||||
:polymorphic => false,
|
:polymorphic => false,
|
||||||
:counter_cache => false
|
:counter_cache => false,
|
||||||
|
:touch => false
|
||||||
}.freeze
|
}.freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ module CollectiveIdea
|
|||||||
if acts_as_nested_set_options[:scope]
|
if acts_as_nested_set_options[:scope]
|
||||||
scope = proc {|node|
|
scope = proc {|node|
|
||||||
scope_column_names.inject("") {|str, column_name|
|
scope_column_names.inject("") {|str, column_name|
|
||||||
str << "AND #{connection.quote_column_name(column_name)} = #{connection.quote(node.send(column_name))} "
|
column_value = node.send(column_name)
|
||||||
|
cond = column_value.nil? ? "IS NULL" : "= #{connection.quote(column_value)}"
|
||||||
|
str << "AND #{connection.quote_column_name(column_name)} #{cond} "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user