We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Description: better_nested_set Rails plugin (my fork from official SVN)
Homepage: http://opensource.symetrie.com/trac/better_nested_set/
Clone URL: git://github.com/chris/better_nested_set.git
Apply Tony Hillerson's patch for Rails 2.1.  I found this fixed failures 
that occurred when calling update_attributes on models that use BNS.  See: 
http://rubyforge.org/pipermail/betternestedset-talk/2008-July/000336.html
chris (author)
Tue Jul 15 09:01:24 -0700 2008
commit  2305b856d1df4c20b6073310010ede813c873dec
tree    65533d5150923f10a16c75ecd3854de83b08225c
parent  0a1089049e0e0abca9ba1deb35221b6d01dfd6a1
...
1093
1094
1095
1096
 
1097
1098
 
 
 
1099
1100
 
1101
1102
1103
1104
1105
...
1093
1094
1095
 
1096
1097
 
1098
1099
1100
1101
 
1102
1103
 
1104
1105
1106
0
@@ -1093,13 +1093,14 @@ module SymetrieCom
0
         private
0
           # override the sql preparation method to exclude the lft/rgt columns
0
           # under the same conditions that the primary key column is excluded
0
- def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true) #:nodoc:
0
+ def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true, attribute_names = @attributes.keys) #:nodoc:
0
             left_and_right_column = [acts_as_nested_set_options[:left_column], acts_as_nested_set_options[:right_column]]
0
- quoted = attributes.inject({}) do |quoted, (name, value)|
0
+ quoted = {}
0
+ connection = self.class.connection
0
+ attribute_names.each do |name|
0
               if column = column_for_attribute(name)
0
- quoted[name] = quote_value(value, column) unless !include_primary_key && (column.primary || left_and_right_column.include?(column.name))
0
+ quoted[name] = connection.quote(read_attribute(name), column) unless !include_primary_key && (column.primary || left_and_right_column.include?(column.name))
0
               end
0
- quoted
0
             end
0
             include_readonly_attributes ? quoted : remove_readonly_attributes(quoted)
0
           end

Comments

    No one has commented yet.