Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Convert sortable scope values to string before comparison.

  • Loading branch information...
commit f1d01727218816d3e1f569c3d6f4d6bf6a14bb86 1 parent 8ca1280
Chris Cherry authored April 23, 2010

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/sortable.rb
2  lib/sortable.rb
@@ -142,7 +142,7 @@ def sortable(options = {})
142 142
         
143 143
         unless instance_methods.include?("#{scope}_with_sortable=")
144 144
           define_method "#{scope}_with_sortable=" do |value|
145  
-            sortable_scope_changes << scope unless sortable_scope_changes.include?(scope) || new_record? || value == send(scope) || !self.class.sortable_lists.any? { |list_name, configuration| configuration[:scope].include?(scope) }
  145
+            sortable_scope_changes << scope unless sortable_scope_changes.include?(scope) || new_record? || value.to_s == send(scope).to_s || !self.class.sortable_lists.any? { |list_name, configuration| configuration[:scope].include?(scope) }
146 146
             send("#{scope}_without_sortable=".to_sym, value)
147 147
           end
148 148
           alias_method_chain "#{scope}=".to_sym, :sortable

0 notes on commit f1d0172

Please sign in to comment.
Something went wrong with that request. Please try again.