Sha256: 3c8ac9f7e9cc6e49a3102eee03d9dc0a44838cc56e6e644d91f2e4ee5e3e079d
Contents?: true
Size: 1.13 KB
Versions: 11
Compression:
Stored size: 1.13 KB
Contents
require 'active_record' require 'action_controller/railtie' require 'action_view/railtie' # database ActiveRecord::Base.configurations = { 'test' => { :adapter => 'sqlite3', :database => ':memory:' } } ActiveRecord::Base.establish_connection 'test' # config app = Class.new(Rails::Application) app.config.secret_token = "aoijg543oi2u88923j4fnvfjt529hg92" app.config.session_store :cookie_store, :key => "_exvo_globalize_session" app.config.active_support.deprecation = :log app.config.i18n.default_locale = :en app.config.i18n.locale = :en app.initialize! # application controller class ApplicationController < ActionController::Base def require_admin redirect_to '/403.html', :status => 403 unless @current_user && @current_user.admin? end end # custom authentication I18n::Backend::GlobalizeStore.authenticator = proc { require_admin } # migration class CreateGlobalizeTranslations < ActiveRecord::Migration def self.up create_table :globalize_translations do |t| t.string :locale t.string :key t.text :value t.text :interpolations t.boolean :is_proc, :default => false t.timestamps end end end
Version data entries
11 entries across 11 versions & 1 rubygems