diff --git a/app/models/swf_asset.rb b/app/models/swf_asset.rb index 89179685..67af14a6 100644 --- a/app/models/swf_asset.rb +++ b/app/models/swf_asset.rb @@ -97,7 +97,7 @@ class SwfAsset < ApplicationRecord def as_json(options={}) super({ - only: [:id], + only: [:id, :known_glitches], methods: [:zone, :restricted_zones, :urls] }.merge(options)) end @@ -110,6 +110,17 @@ class SwfAsset < ApplicationRecord } end + def known_glitches + self[:known_glitches].split(',') + end + + def known_glitches=(new_known_glitches) + if new_known_glitches.is_a? Array + new_known_glitches = new_known_glitches.join(',') + end + self[:known_glitches] = new_known_glitches + end + def restricted_zone_ids [].tap do |ids| zones_restrict.chars.each_with_index do |bit, index|