Cleanup routings

This commit is contained in:
Alexander Meindl
2018-01-28 11:47:25 +01:00
parent f44366bd75
commit b1a527fc52
19 changed files with 31 additions and 68 deletions

View File

@@ -1,4 +1,3 @@
# Redmine Messenger plugin for Redmine
require 'net/http'
class Messenger

View File

@@ -1,11 +1,7 @@
# Redmine Messenger plugin for Redmine
class MessengerSetting < ActiveRecord::Base
include Redmine::SafeAttributes
belongs_to :project
validates :project_id, presence: true
safe_attributes 'messenger_url',
'messenger_icon',
'messenger_channel',
@@ -30,7 +26,7 @@ class MessengerSetting < ActiveRecord::Base
'post_password',
'post_password_updates'
attr_protected :id
attr_protected :id, :project_id
def self.find_or_create(p_id)
setting = MessengerSetting.find_by(project_id: p_id)