forked from OpenNeo/impress
Add known_glitches to appearances JSON
This commit is contained in:
parent
010f64264f
commit
6c31094c2d
1 changed files with 12 additions and 1 deletions
|
@ -97,7 +97,7 @@ class SwfAsset < ApplicationRecord
|
||||||
|
|
||||||
def as_json(options={})
|
def as_json(options={})
|
||||||
super({
|
super({
|
||||||
only: [:id],
|
only: [:id, :known_glitches],
|
||||||
methods: [:zone, :restricted_zones, :urls]
|
methods: [:zone, :restricted_zones, :urls]
|
||||||
}.merge(options))
|
}.merge(options))
|
||||||
end
|
end
|
||||||
|
@ -110,6 +110,17 @@ class SwfAsset < ApplicationRecord
|
||||||
}
|
}
|
||||||
end
|
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
|
def restricted_zone_ids
|
||||||
[].tap do |ids|
|
[].tap do |ids|
|
||||||
zones_restrict.chars.each_with_index do |bit, index|
|
zones_restrict.chars.each_with_index do |bit, index|
|
||||||
|
|
Loading…
Reference in a new issue