Initial Rails4 Port

This commit is contained in:
Henne Vogelsang 2014-04-23 15:45:55 +02:00
parent 5923a66a88
commit 2e9b92c3af
19 changed files with 394 additions and 817 deletions

View file

@ -1,8 +1,12 @@
defaults: &defaults
# The name of your instance
name: OSEM
# The sender address of emails
devise_mail_sender: "no-reply@localhost"
# The hostname to be used when building the URL in the emails
url_for_emails: "localhost:3000"
# A secret key for your rails app. You can generate one with 'rake secret'
secret_key: 12345
# A secret key. You can generate one with 'rake secret'
devise_secret_key: '12345'
# errbit configuration, get your own instance: https://github.com/errbit/errbit

View file

@ -1,8 +1,8 @@
# Load the rails application
require File.expand_path('../application', __FILE__)
# Load the configuration file
path = Rails.root.join("config", "config.yml")
begin
CONFIG = YAML.load_file(path)[Rails.env]
rescue Exception
@ -12,3 +12,4 @@ end
# Initialize the rails application
Osem::Application.initialize!
Osem::Application.config.secret_keybase = CONFIG['secret_key']

View file

@ -9,9 +9,6 @@ Osem::Application.configure do
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
@ -28,15 +25,16 @@ Osem::Application.configure do
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
# Do not eager load code on boot.
config.eager_load = false
# Set the detault url for action mailer
config.action_mailer.default_url_options = { :host => CONFIG['url_for_emails'] }
end

View file

@ -8,6 +8,12 @@ Osem::Application.configure do
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both thread web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
@ -60,10 +66,6 @@ Osem::Application.configure do
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
# config.active_record.auto_explain_threshold_in_seconds = 0.5
# Set the detault url for action mailer
config.action_mailer.default_url_options = { :host => CONFIG['url_for_emails'] }
end

View file

@ -11,8 +11,8 @@ Osem::Application.configure do
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
# Log error messages when you accidentally call methods on nil
config.whiny_nils = true
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching
config.consider_all_requests_local = true

View file

@ -1,12 +1,13 @@
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# ==> Secret key
config.secret_key = CONFIG['devise_secret_key']
# ==> Secret key, generate one with `rake secret`
config.secret_key = CONFIG['devise_secret_key']
# ==> Mailer Configuration
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
config.mailer_sender = CONFIG['devise_mail_sender']
config.mailer_sender = CONFIG['sender_for_emails']
# Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer"

View file

@ -17,13 +17,13 @@ Osem::Application.routes.draw do
delete "/registrations" => "registrations#delete"
put "/registrations/change_field" => "registrations#change_field"
get "/emailsettings" => "emails#show", :as => "email_settings"
put "/emailsettings" => "emails#update", :as => "email_settings"
get "/supporter_levels" => "SupporterLevels#show"
put "/supporter_levels" => "SupporterLevels#update"
put "/emailsettings" => "emails#update"
get "/supporter_levels" => "supporter_levels#show"
put "/supporter_levels" => "supporter_levels#update"
get "/venue" => "venue#show", :as => "venue_info"
put "/venue" => "venue#update", :as => "venue_update"
get "/social_events" => "SocialEvents#show", :as => "social_events"
put "/social_events" => "SocialEvents#update", :as => "social_events"
get "/social_events" => "social_events#show", :as => "social_events"
put "/social_events" => "social_events#update"
get "/rooms" => "rooms#show", :as => "rooms_list"
put "/rooms" => "rooms#update", :as => "rooms_update"
get "/tracks" => "tracks#show", :as => "tracks_list"
@ -57,16 +57,16 @@ Osem::Application.routes.draw do
resources :conference, :only => [] do
resources :proposal do
resources :event_attachment, :controller => "EventAttachments"
resources :event_attachment, :controller => "event_attachments"
put "/confirm" => "proposal#confirm"
end
resource :schedule, :only => [] do
get "/" => "schedule#index"
end
member do
get "/register" => "ConferenceRegistration#register"
put "/register" => "ConferenceRegistration#update"
delete "/register" => "ConferenceRegistration#unregister"
get "/register" => "conference_registration#register"
put "/register" => "conference_registration#update"
delete "/register" => "conference_registration#unregister"
end
end
@ -86,7 +86,7 @@ Osem::Application.routes.draw do
end
end
match "/admin" => redirect("/admin/conference")
get "/admin" => redirect("/admin/conference")
root :to => "home#index"
end