Add /pixiv_ugoira_frame_data.json endpoint.

This commit is contained in:
evazion
2020-02-24 22:42:25 -06:00
parent 7c71311eef
commit 406bc5d87f
3 changed files with 21 additions and 0 deletions

View File

@@ -1,7 +1,19 @@
class PixivUgoiraFrameData < ApplicationRecord
belongs_to :post
serialize :data
before_validation :normalize_data, on: :create
def self.available_includes
[:post]
end
def self.search(params)
q = super
q = q.search_attributes(params, :post, :data, :content_type)
q.apply_default_order(params)
end
def normalize_data
return if data.nil?