trabajo-afectivo/app/controllers/chats_controller.rb

38 lines
752 B
Ruby
Raw Normal View History

2016-10-19 03:11:36 +00:00
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
2015-11-16 10:44:13 +00:00
class ChatsController < ApplicationController
2017-10-13 06:22:37 +00:00
prepend_before_action { authentication_check(permission: 'admin.channel_chat') }
2015-11-16 10:44:13 +00:00
def index
chat_ids = []
assets = {}
Chat.order(:id).each do |chat|
2015-11-16 10:44:13 +00:00
chat_ids.push chat.id
assets = chat.assets(assets)
end
2015-11-25 22:24:08 +00:00
setting = Setting.find_by(name: 'chat')
assets = setting.assets(assets)
2015-11-16 10:44:13 +00:00
render json: {
chat_ids: chat_ids,
assets: assets,
}
end
def show
model_show_render(Chat, params)
end
def create
model_create_render(Chat, params)
end
def update
model_update_render(Chat, params)
end
def destroy
model_destroy_render(Chat, params)
2015-11-16 10:44:13 +00:00
end
2015-11-16 10:44:13 +00:00
end