+# -*- coding: utf-8 -*-
require "json"
class Admin::ServiceCooperationsController < Admin::BaseController
+ before_filter :admin_permission_check_service_cooperation
def index
@services = ServiceCooperation.all
json = JSON::pretty_generate(data)
render :text => json.to_s
end
+ else
+ render :text => ""
end
end
--- /dev/null
+# -*- coding: utf-8 -*-
+class AddDataFunctionsServiceCooperations < ActiveRecord::Migration
+ def self.up
+ Function.create(:name => 'アイテムマスタ設定', :code => 'service_cooperation', :position => 1005)
+ f = Function.find_by_code('service_cooperation')
+ now = ActiveRecord::Base.connection.quote(Time.now.utc)
+ Authority.find(:all).each do |auth|
+ execute("INSERT INTO authorities_functions (authority_id, create_at, function_id, update_at) VALUES (#{auth.id}, #{now}, #{f.id}, #{now})")
+ end
+ end
+
+ def self.down
+ f = Function.find_by_code('service_cooperation')
+ Authority.find(:all).each do |auth|
+ AuthoritiesFunction.delete_all(["authority_id = :authority_id and function_id = :function_id", {:authority_id => auth.id, :function_id => f.id}])
+ end
+ f.delete
+ end
+end
+# -*- coding: utf-8 -*-
require 'spec_helper'
describe Admin::ServiceCooperationsController do
before do
session[:admin_user] = admin_users(:admin10)
- @controller.class.skip_before_filter :admin_permission_check_template
+ @controller.class.skip_before_filter :admin_permission_check_service_cooperation
end
describe "GET 'index'管理画面サービス一覧ページ" do