Add once off job to “migrate” the Rule model
We can’t use an actual activerecord migration because everything is JSON serialised :(
This commit is contained in:
parent
f3347b0a92
commit
6aa94fcb27
|
@ -48,3 +48,5 @@ require_relative "../services/manager"
|
||||||
require_relative "../jobs/regular/notify_chats"
|
require_relative "../jobs/regular/notify_chats"
|
||||||
|
|
||||||
require_relative "../../lib/discourse_chat/provider"
|
require_relative "../../lib/discourse_chat/provider"
|
||||||
|
|
||||||
|
require_relative "../jobs/onceoff/add_type_field"
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
module Jobs
|
||||||
|
class DiscourseChatAddTypeField < Jobs::Onceoff
|
||||||
|
def execute_onceoff(args)
|
||||||
|
DiscourseChat::Rule.find_each do |rule|
|
||||||
|
rule.save(validate: false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue