OSDN Git Service

別端末からセッションハイジャックを防ぐ仕組みを導入
[elecoma/elecoma.git] / config / environment.rb
1 # -*- coding: utf-8 -*-
2 # Be sure to restart your server when you modify this file
3
4 # Specifies gem version of Rails to use when vendor/rails is not present
5 #RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
6
7 # Bootstrap the Rails environment, frameworks, and default configuration
8 require File.join(File.dirname(__FILE__), 'boot')
9 require 'gettext'
10
11 Rails::Initializer.run do |config|
12   # Settings in config/environments/* take precedence over those specified here.
13   # Application configuration should go into files in config/initializers
14   # -- all .rb files in that directory are automatically loaded.
15
16   # Add additional load paths for your own custom dirs
17   # config.load_paths += %W( #{RAILS_ROOT}/extras )
18
19   # Specify gems that this application depends on and have them installed with rake gems:install
20   # config.gem "bj"
21   # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
22   # config.gem "sqlite3-ruby", :lib => "sqlite3"
23   # config.gem "aws-s3", :lib => "aws/s3"
24
25   # Only load the plugins named here, in the order given (default is alphabetical).
26   # :all can be used as a placeholder for all plugins not explicitly named
27   # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
28
29   # Skip frameworks you're not going to use. To use Rails without a database,
30   # you must remove the Active Record framework.
31   # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
32
33   # Activate observers that should always be running
34   # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
35
36   # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
37   # Run "rake -D time" for a list of tasks for finding time zone names.
38   #config.time_zone = 'UTC'
39   #config.time_zone = 'Tokyo'
40   config.active_record.default_timezone = 'Tokyo' 
41
42   # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
43   # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
44   config.i18n.default_locale = 'ja'
45
46   config.action_controller.session = {:cookie_only => false}
47 end
48
49 module ActionView
50   class Base
51     delegate :file_exists?, :to => :finder unless respond_to?(:file_exists?)
52   end
53 end
54
55 require 'action_view_helper'
56 require 'active_record_helper'
57 require 'will_paginate'
58 require 'validates'
59 require 'rexml-expansion-fix'
60 require 'create_fixtures'
61 require 'security_token'
62 require 'csv_util'
63 require 'check_session_signature'
64
65 list = Dir["app/models/*.rb"]
66 list.each do |i|
67   model = Object.const_get(File.basename(i, '.rb').camelize)
68   if model.superclass == ActiveRecord::Base && model.table_exists?
69     model.new
70   end
71 end
72
73 # unsuported_device_mobile.html.erb で使用されるページネーションレンダラ
74 class UnsupportedDeviceLinkRenderer < WillPaginate::LinkRenderer
75   def page_link(page, text, attributes = {})
76     @template.link_to text, url_for(page), {}
77   end
78
79   def page_span(page, text, attributes = {})
80 #    @template.content_tag :span, text, {}
81   end  
82 end