# @api public
module ::RailsConnector
PLATFORM_CLOUD = :cloud
PLATFORM_FIONA = :fiona
# return either :fiona or :cloud depending on the app's configuration.
# @return [Symbol]
def self.platform
PLATFORM_FIONA
end
def self.platform_cloud?
false
end
def self.platform_fiona?
true
end
end
require "rails_connector/core_extensions"
require "rails_connector/rack_middlewares"
require "rails_connector/errors"
require "rails_connector/fiona_datetime"
ActiveRecord::Type.register(:fiona_datetime, ::FionaDateTime)
# @api public
module RailsConnector
def self.autoload_all_sources
source_files = Dir.glob(File.expand_path("rails_connector/*.rb", __dir__)).map do |file|
File.basename(file)
end
source_files.each do |file|
name = file.gsub(".rb", "")
autoload name.camelcase, "rails_connector/#{name}"
end
end
autoload_all_sources
end
require "rails_connector/engine" if defined?(Rails)
require "rails_connector/fiona_engine" if defined?(Rails)