Skip to content

Commit

Permalink
ar.rb: Use .sort_by as suggested by rampion
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Mar 30, 2010
1 parent 6c8de5c commit 55a6e72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/camping/ar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def self.create_schema(opts = {})
si = SchemaInfo.find(:first) || SchemaInfo.new(:version => opts[:assume])
if si.version < opts[:version]
(@migrations.sort do |a,b| a.version <=> b.version end).each do |k|
@migrations.sort_by { |m| m.version }.each do |k|
k.migrate(:up) if si.version < k.version and k.version <= opts[:version]
k.migrate(:down) if si.version > k.version and k.version > opts[:version]
end
Expand Down

0 comments on commit 55a6e72

Please sign in to comment.