Skip to content

Commit

Permalink
Added sorting by option type to options_text helper.
Browse files Browse the repository at this point in the history
  • Loading branch information
romul committed Jan 10, 2011
1 parent 24ea443 commit eb1ab87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/app/models/variant.rb
Expand Up @@ -74,7 +74,7 @@ def available?
end

def options_text
self.option_values.map { |ov| "#{ov.option_type.presentation}: #{ov.presentation}" }.to_sentence({:words_connector => ", ", :two_words_connector => ", "})
self.option_values.sort{|ov1, ov2| ov1.option_type.id <=> ov2.option_type.id}.map { |ov| "#{ov.option_type.presentation}: #{ov.presentation}" }.to_sentence({:words_connector => ", ", :two_words_connector => ", "})
end

def gross_profit
Expand Down

0 comments on commit eb1ab87

Please sign in to comment.