check if items are compatible before saving
This commit is contained in:
parent
04138ac4a7
commit
3ab730135f
1 changed files with 2 additions and 1 deletions
|
@ -127,7 +127,7 @@ class Item < ActiveRecord::Base
|
||||||
items = {}
|
items = {}
|
||||||
item_ids = []
|
item_ids = []
|
||||||
info_registry.each do |info|
|
info_registry.each do |info|
|
||||||
if info
|
if info && info[:is_compatible]
|
||||||
item_ids << info[:obj_info_id].to_i
|
item_ids << info[:obj_info_id].to_i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -155,6 +155,7 @@ class Item < ActiveRecord::Base
|
||||||
asset_registry.each do |asset_data|
|
asset_registry.each do |asset_data|
|
||||||
if asset_data
|
if asset_data
|
||||||
item_id = asset_data[:obj_info_id].to_i
|
item_id = asset_data[:obj_info_id].to_i
|
||||||
|
next unless item_ids.include?(item_id) # skip incompatible
|
||||||
item = items[item_id]
|
item = items[item_id]
|
||||||
unless item
|
unless item
|
||||||
item = Item.new
|
item = Item.new
|
||||||
|
|
Loading…
Reference in a new issue