Make database offline mode work
This commit is contained in:
parent
f980e7e4a6
commit
8af14faa49
8 changed files with 106 additions and 84 deletions
|
@ -51,7 +51,9 @@ Rails::Initializer.run do |config|
|
|||
# config.gem "bj"
|
||||
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
|
||||
# config.gem "aws-s3", :lib => "aws/s3"
|
||||
unless OSM_STATUS == :database_offline
|
||||
config.gem 'composite_primary_keys', :version => '2.2.2'
|
||||
end
|
||||
config.gem 'libxml-ruby', :version => '>= 1.1.1', :lib => 'libxml'
|
||||
config.gem 'rmagick', :lib => 'RMagick'
|
||||
config.gem 'oauth', :version => '>= 0.3.6'
|
||||
|
@ -86,7 +88,9 @@ Rails::Initializer.run do |config|
|
|||
# Use the database for sessions instead of the cookie-based default,
|
||||
# which shouldn't be used to store highly confidential information
|
||||
# (create the session table with 'rake db:sessions:create')
|
||||
unless OSM_STATUS == :database_offline
|
||||
config.action_controller.session_store = :sql_session_store
|
||||
end
|
||||
|
||||
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
||||
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
module ActiveRecord
|
||||
if defined?(ActionRecord::ConnectionAdaptors::AbstractAdaptor)
|
||||
module ActiveRecord
|
||||
module ConnectionAdapters
|
||||
class AbstractAdapter
|
||||
protected
|
||||
|
@ -23,4 +24,5 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
module ActiveRecord
|
||||
if defined?(ActionRecord::ConnectionAdaptors::PostgreSQLAdaptor)
|
||||
module ActiveRecord
|
||||
module ConnectionAdapters
|
||||
class PostgreSQLAdapter
|
||||
def pk_and_sequence_for(table)
|
||||
|
@ -52,4 +53,5 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
module ActiveRecord
|
||||
if defined?(ActionRecord::ConnectionAdaptors::QueryCache)
|
||||
module ActiveRecord
|
||||
module ConnectionAdapters
|
||||
module QueryCache
|
||||
private
|
||||
|
@ -7,4 +8,5 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,4 +4,6 @@ adapter = Rails.configuration.database_configuration[environment]["adapter"]
|
|||
session_class = adapter + "_session"
|
||||
|
||||
# Configure SqlSessionStore
|
||||
SqlSessionStore.session_class = session_class.camelize.constantize
|
||||
unless OSM_STATUS == :database_offline
|
||||
SqlSessionStore.session_class = session_class.camelize.constantize
|
||||
end
|
||||
|
|
5
vendor/plugins/deadlock_retry/init.rb
vendored
5
vendor/plugins/deadlock_retry/init.rb
vendored
|
@ -1,2 +1,5 @@
|
|||
require 'deadlock_retry'
|
||||
ActiveRecord::Base.send :include, DeadlockRetry
|
||||
|
||||
if defined?(ActionRecord::Base)
|
||||
ActiveRecord::Base.send :include, DeadlockRetry
|
||||
end
|
||||
|
|
11
vendor/plugins/file_column/init.rb
vendored
11
vendor/plugins/file_column/init.rb
vendored
|
@ -8,6 +8,11 @@ require 'file_column_helper'
|
|||
require 'validations'
|
||||
require 'test_case'
|
||||
|
||||
ActiveRecord::Base.send(:include, FileColumn)
|
||||
ActionView::Base.send(:include, FileColumnHelper)
|
||||
ActiveRecord::Base.send(:include, FileColumn::Validations)
|
||||
if defined?(ActionRecord::Base)
|
||||
ActiveRecord::Base.send(:include, FileColumn)
|
||||
ActiveRecord::Base.send(:include, FileColumn::Validations)
|
||||
end
|
||||
|
||||
if defined?(ActionView::Base)
|
||||
ActionView::Base.send(:include, FileColumnHelper)
|
||||
end
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
require 'validates_email_format_of'
|
||||
if defined?(ActionRecord::Base)
|
||||
require 'validates_email_format_of'
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue