mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 22:56:22 +00:00
Merge branch 'rails' of 0xacab.org:sutty/sutty into issue-13244
This commit is contained in:
commit
823b191872
3 changed files with 36 additions and 0 deletions
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
public/assets/** filter=lfs diff=lfs merge=lfs -text
|
||||
public/packs/** filter=lfs diff=lfs merge=lfs -text
|
22
app/lib/active_job/serializers/exception_serializer.rb
Normal file
22
app/lib/active_job/serializers/exception_serializer.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'json/add/exception'
|
||||
|
||||
module ActiveJob
|
||||
module Serializers
|
||||
class ExceptionSerializer < ObjectSerializer # :nodoc:
|
||||
def serialize(ex)
|
||||
super('value' => { 'class' => ex.class.name, 'exception' => ex.as_json })
|
||||
end
|
||||
|
||||
def deserialize(hash)
|
||||
hash.dig('value', 'class').constantize.json_create(hash.dig('value', 'exception'))
|
||||
end
|
||||
|
||||
private
|
||||
def klass
|
||||
Exception
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
12
db/migrate/20230328231029_create_que_tables.rb
Normal file
12
db/migrate/20230328231029_create_que_tables.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Que
|
||||
class CreateQueTables < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
Que.migrate! version: 7
|
||||
end
|
||||
|
||||
def down
|
||||
Que.migrate! version: 0
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue