Charles F. Munat
2007-Oct-24  08:51 UTC
[Betternestedset-talk] attributes_with_quotes error
To work with the latest Edge Rails (8009 as of this writing), this:
<lib/better_nested_set.rb:1093>
def attributes_with_quotes(include_primary_key = true) #:nodoc:
   attributes.inject({}) do |quoted, (name, value)|
     if column = column_for_attribute(name)
       quoted[name] = quote_value(value, column) unless
         !include_primary_key &&
         (column.primary ||
           [acts_as_nested_set_options[:left_column],
           acts_as_nested_set_options[:right_column]].include?(column.name))
     end
     quoted
   end
end
Must be changed to this:
def attributes_with_quotes(include_primary_key = true,
     include_readonly_attributes = true) #:nodoc:
   quoted = attributes.inject({}) do |quoted, (name, value)|
     if column = column_for_attribute(name)
       quoted[name] = quote_value(value, column) unless
         !include_primary_key &&
         (column.primary ||
           [acts_as_nested_set_options[:left_column],
acts_as_nested_set_options[:right_column]].include?(column.name))
     end
     quoted
   end
   include_readonly_attributes ? quoted : remove_readonly_attributes(quoted)
end
Sorry for the wrapping.
Charles F. Munat
Seattle