mirror of
https://github.com/discourse/discourse-chat-integration.git
synced 2025-02-09 21:14:47 +00:00
FIX: Save on chat_controller ready for Rails 6.0.0 (#31)
I think that passing attributes to save method is not necessary when the Object was initialized with them. Problem is that with Rails 6.0.0 (https://github.com/discourse/discourse/pull/8083) this code is not working https://travis-ci.org/discourse/discourse/jobs/582556988
This commit is contained in:
parent
82351a790c
commit
df44beb9a3
@ -79,7 +79,7 @@ class DiscourseChat::ChatController < ApplicationController
|
|||||||
|
|
||||||
channel = DiscourseChat::Channel.new(hash)
|
channel = DiscourseChat::Channel.new(hash)
|
||||||
|
|
||||||
if !channel.save(hash)
|
if !channel.save
|
||||||
raise Discourse::InvalidParameters, 'Channel is not valid'
|
raise Discourse::InvalidParameters, 'Channel is not valid'
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ class DiscourseChat::ChatController < ApplicationController
|
|||||||
hash = params.require(:rule).permit(:channel_id, :type, :filter, :group_id, :category_id, tags: [])
|
hash = params.require(:rule).permit(:channel_id, :type, :filter, :group_id, :category_id, tags: [])
|
||||||
rule = DiscourseChat::Rule.new(hash)
|
rule = DiscourseChat::Rule.new(hash)
|
||||||
|
|
||||||
if !rule.save(hash)
|
if !rule.save
|
||||||
raise Discourse::InvalidParameters, 'Rule is not valid'
|
raise Discourse::InvalidParameters, 'Rule is not valid'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user