Commit 76881578 by ivan Lan

Fix snapshot validation :check_spec_value to ignore ary order

parent 4e474b98
...@@ -185,6 +185,7 @@ module Shotengai ...@@ -185,6 +185,7 @@ module Shotengai
super super
end end
# beause relation :snapshots has many types, so do not use order.snapshot to create or init a obj
def can_buy *good_class_names def can_buy *good_class_names
good_classes = good_class_names.map(&:constantize) good_classes = good_class_names.map(&:constantize)
# 所有snapshot # 所有snapshot
......
...@@ -159,7 +159,7 @@ module Shotengai ...@@ -159,7 +159,7 @@ module Shotengai
# spec 字段 # spec 字段
def check_spec_value def check_spec_value
errors.add(:spec_value, 'spec 与 所给系列不符。') unless spec_value.nil? || spec_value.keys == shotengai_series.spec_value.keys errors.add(:spec_value, 'spec 与 所给系列不符。') unless spec_value.nil? || spec_value.keys.sort == shotengai_series.spec_value.keys.sort
end end
def remark_template_empty? def remark_template_empty?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment