upgrade to rails v4.0.2
This commit is contained in:
parent
8a76402c1b
commit
9b0294c471
|
@ -1,14 +1,15 @@
|
||||||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
||||||
#
|
#
|
||||||
# If you find yourself ignoring temporary files generated by your text editor
|
# If you find yourself ignoring temporary files generated by your text editor
|
||||||
# or operating system, you probably want to add a global ignore instead:
|
# or operating system, you probably want to add a global ignore instead:
|
||||||
# git config --global core.excludesfile ~/.gitignore_global
|
# git config --global core.excludesfile '~/.gitignore_global'
|
||||||
|
|
||||||
# Ignore bundler config
|
# Ignore bundler config.
|
||||||
/.bundle
|
/.bundle
|
||||||
|
|
||||||
# Ignore the default SQLite database.
|
# Ignore the default SQLite database.
|
||||||
/db/*.sqlite3
|
/db/*.sqlite3
|
||||||
|
/db/*.sqlite3-journal
|
||||||
/db/sphinx
|
/db/sphinx
|
||||||
|
|
||||||
# Ignore all logfiles and tempfiles.
|
# Ignore all logfiles and tempfiles.
|
||||||
|
|
23
Gemfile
23
Gemfile
|
@ -1,26 +1,29 @@
|
||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
gem "rails", "3.2.16"
|
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
|
||||||
|
gem "rails", "4.0.2"
|
||||||
|
|
||||||
gem "rake", "10.0.3"
|
# Use mysql2 as the database for Active Record
|
||||||
|
gem "mysql2", ">= 0.3.14"
|
||||||
|
|
||||||
# Bundle edge Rails instead:
|
# Use Rails3-style mass assignment security
|
||||||
# gem "rails", :git => "git://github.com/rails/rails.git"
|
gem "protected_attributes"
|
||||||
|
|
||||||
gem "mysql2", :git => "git://github.com/brianmario/mysql2.git"
|
# Use Uglifier as compressor for JavaScript assets
|
||||||
|
gem "uglifier", ">= 1.3.0"
|
||||||
gem "bcrypt-ruby", "3.0.0"
|
|
||||||
|
|
||||||
|
# Use jquery as the JavaScript library
|
||||||
gem "jquery-rails"
|
gem "jquery-rails"
|
||||||
gem "dynamic_form"
|
gem "dynamic_form"
|
||||||
|
|
||||||
# use old version that doesn't have tinder bullshit
|
# use old version that doesn't have tinder bullshit
|
||||||
gem "exception_notification", "2.6.1"
|
gem "exception_notification", "2.6.1"
|
||||||
|
|
||||||
gem "unicorn"
|
# Use ActiveModel has_secure_password
|
||||||
|
gem "bcrypt-ruby", "~> 3.1.2"
|
||||||
|
|
||||||
# for asset compilation
|
# Use unicorn as the app server
|
||||||
gem "uglifier"
|
gem "unicorn"
|
||||||
|
|
||||||
gem "nokogiri"
|
gem "nokogiri"
|
||||||
gem "htmlentities"
|
gem "htmlentities"
|
||||||
|
|
123
Gemfile.lock
123
Gemfile.lock
|
@ -1,42 +1,34 @@
|
||||||
GIT
|
|
||||||
remote: git://github.com/brianmario/mysql2.git
|
|
||||||
revision: a9787cbb88f18d12f0b5c370c519d077ad68c862
|
|
||||||
specs:
|
|
||||||
mysql2 (0.3.14)
|
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (3.2.16)
|
actionmailer (4.0.2)
|
||||||
actionpack (= 3.2.16)
|
actionpack (= 4.0.2)
|
||||||
mail (~> 2.5.4)
|
mail (~> 2.5.4)
|
||||||
actionpack (3.2.16)
|
actionpack (4.0.2)
|
||||||
activemodel (= 3.2.16)
|
activesupport (= 4.0.2)
|
||||||
activesupport (= 3.2.16)
|
builder (~> 3.1.0)
|
||||||
builder (~> 3.0.0)
|
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
journey (~> 1.0.4)
|
rack (~> 1.5.2)
|
||||||
rack (~> 1.4.5)
|
rack-test (~> 0.6.2)
|
||||||
rack-cache (~> 1.2)
|
activemodel (4.0.2)
|
||||||
rack-test (~> 0.6.1)
|
activesupport (= 4.0.2)
|
||||||
sprockets (~> 2.2.1)
|
builder (~> 3.1.0)
|
||||||
activemodel (3.2.16)
|
activerecord (4.0.2)
|
||||||
activesupport (= 3.2.16)
|
activemodel (= 4.0.2)
|
||||||
builder (~> 3.0.0)
|
activerecord-deprecated_finders (~> 1.0.2)
|
||||||
activerecord (3.2.16)
|
activesupport (= 4.0.2)
|
||||||
activemodel (= 3.2.16)
|
arel (~> 4.0.0)
|
||||||
activesupport (= 3.2.16)
|
activerecord-deprecated_finders (1.0.3)
|
||||||
arel (~> 3.0.2)
|
activesupport (4.0.2)
|
||||||
tzinfo (~> 0.3.29)
|
|
||||||
activeresource (3.2.16)
|
|
||||||
activemodel (= 3.2.16)
|
|
||||||
activesupport (= 3.2.16)
|
|
||||||
activesupport (3.2.16)
|
|
||||||
i18n (~> 0.6, >= 0.6.4)
|
i18n (~> 0.6, >= 0.6.4)
|
||||||
multi_json (~> 1.0)
|
minitest (~> 4.2)
|
||||||
arel (3.0.3)
|
multi_json (~> 1.3)
|
||||||
bcrypt-ruby (3.0.0)
|
thread_safe (~> 0.1)
|
||||||
builder (3.0.4)
|
tzinfo (~> 0.3.37)
|
||||||
|
arel (4.0.1)
|
||||||
|
atomic (1.1.14)
|
||||||
|
bcrypt-ruby (3.1.2)
|
||||||
|
builder (3.1.4)
|
||||||
diff-lcs (1.2.5)
|
diff-lcs (1.2.5)
|
||||||
dynamic_form (1.1.4)
|
dynamic_form (1.1.4)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
|
@ -45,8 +37,7 @@ GEM
|
||||||
execjs (2.0.2)
|
execjs (2.0.2)
|
||||||
hike (1.2.3)
|
hike (1.2.3)
|
||||||
htmlentities (4.3.1)
|
htmlentities (4.3.1)
|
||||||
i18n (0.6.8)
|
i18n (0.6.9)
|
||||||
journey (1.0.4)
|
|
||||||
jquery-rails (3.0.4)
|
jquery-rails (3.0.4)
|
||||||
railties (>= 3.0, < 5.0)
|
railties (>= 3.0, < 5.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
|
@ -58,38 +49,34 @@ GEM
|
||||||
treetop (~> 1.4.8)
|
treetop (~> 1.4.8)
|
||||||
mime-types (1.25.1)
|
mime-types (1.25.1)
|
||||||
mini_portile (0.5.2)
|
mini_portile (0.5.2)
|
||||||
|
minitest (4.7.5)
|
||||||
multi_json (1.8.2)
|
multi_json (1.8.2)
|
||||||
nokogiri (1.6.0)
|
mysql2 (0.3.14)
|
||||||
|
nokogiri (1.6.1)
|
||||||
mini_portile (~> 0.5.0)
|
mini_portile (~> 0.5.0)
|
||||||
oauth (0.4.7)
|
oauth (0.4.7)
|
||||||
polyglot (0.3.3)
|
polyglot (0.3.3)
|
||||||
rack (1.4.5)
|
protected_attributes (1.0.5)
|
||||||
rack-cache (1.2)
|
activemodel (>= 4.0.1, < 5.0)
|
||||||
rack (>= 0.4)
|
rack (1.5.2)
|
||||||
rack-ssl (1.3.3)
|
|
||||||
rack
|
|
||||||
rack-test (0.6.2)
|
rack-test (0.6.2)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (3.2.16)
|
rails (4.0.2)
|
||||||
actionmailer (= 3.2.16)
|
actionmailer (= 4.0.2)
|
||||||
actionpack (= 3.2.16)
|
actionpack (= 4.0.2)
|
||||||
activerecord (= 3.2.16)
|
activerecord (= 4.0.2)
|
||||||
activeresource (= 3.2.16)
|
activesupport (= 4.0.2)
|
||||||
activesupport (= 3.2.16)
|
bundler (>= 1.3.0, < 2.0)
|
||||||
bundler (~> 1.0)
|
railties (= 4.0.2)
|
||||||
railties (= 3.2.16)
|
sprockets-rails (~> 2.0.0)
|
||||||
railties (3.2.16)
|
railties (4.0.2)
|
||||||
actionpack (= 3.2.16)
|
actionpack (= 4.0.2)
|
||||||
activesupport (= 3.2.16)
|
activesupport (= 4.0.2)
|
||||||
rack-ssl (~> 1.3.2)
|
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
rdoc (~> 3.4)
|
thor (>= 0.18.1, < 2.0)
|
||||||
thor (>= 0.14.6, < 2.0)
|
|
||||||
raindrops (0.12.0)
|
raindrops (0.12.0)
|
||||||
rake (10.0.3)
|
rake (10.1.1)
|
||||||
rdiscount (2.1.7)
|
rdiscount (2.1.7)
|
||||||
rdoc (3.12.2)
|
|
||||||
json (~> 1.4)
|
|
||||||
riddle (1.5.9)
|
riddle (1.5.9)
|
||||||
rspec-core (2.14.7)
|
rspec-core (2.14.7)
|
||||||
rspec-expectations (2.14.4)
|
rspec-expectations (2.14.4)
|
||||||
|
@ -102,23 +89,29 @@ GEM
|
||||||
rspec-core (~> 2.14.0)
|
rspec-core (~> 2.14.0)
|
||||||
rspec-expectations (~> 2.14.0)
|
rspec-expectations (~> 2.14.0)
|
||||||
rspec-mocks (~> 2.14.0)
|
rspec-mocks (~> 2.14.0)
|
||||||
sprockets (2.2.2)
|
sprockets (2.10.1)
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
tilt (~> 1.1, != 1.3.0)
|
||||||
|
sprockets-rails (2.0.1)
|
||||||
|
actionpack (>= 3.0)
|
||||||
|
activesupport (>= 3.0)
|
||||||
|
sprockets (~> 2.8)
|
||||||
sqlite3 (1.3.8)
|
sqlite3 (1.3.8)
|
||||||
thinking-sphinx (2.0.12)
|
thinking-sphinx (2.0.12)
|
||||||
activerecord (>= 3.0.3)
|
activerecord (>= 3.0.3)
|
||||||
builder (>= 2.1.2)
|
builder (>= 2.1.2)
|
||||||
riddle (>= 1.5.2)
|
riddle (>= 1.5.2)
|
||||||
thor (0.18.1)
|
thor (0.18.1)
|
||||||
|
thread_safe (0.1.3)
|
||||||
|
atomic
|
||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
treetop (1.4.15)
|
treetop (1.4.15)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
tzinfo (0.3.38)
|
tzinfo (0.3.38)
|
||||||
uglifier (2.3.2)
|
uglifier (2.4.0)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
json (>= 1.8.0)
|
json (>= 1.8.0)
|
||||||
unicorn (4.7.0)
|
unicorn (4.7.0)
|
||||||
|
@ -130,21 +123,21 @@ PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
bcrypt-ruby (= 3.0.0)
|
bcrypt-ruby (~> 3.1.2)
|
||||||
dynamic_form
|
dynamic_form
|
||||||
exception_notification (= 2.6.1)
|
exception_notification (= 2.6.1)
|
||||||
htmlentities
|
htmlentities
|
||||||
jquery-rails
|
jquery-rails
|
||||||
machinist
|
machinist
|
||||||
mail
|
mail
|
||||||
mysql2!
|
mysql2 (>= 0.3.14)
|
||||||
nokogiri
|
nokogiri
|
||||||
oauth
|
oauth
|
||||||
rails (= 3.2.16)
|
protected_attributes
|
||||||
rake (= 10.0.3)
|
rails (= 4.0.2)
|
||||||
rdiscount
|
rdiscount
|
||||||
rspec-rails (~> 2.6)
|
rspec-rails (~> 2.6)
|
||||||
sqlite3
|
sqlite3
|
||||||
thinking-sphinx (= 2.0.12)
|
thinking-sphinx (= 2.0.12)
|
||||||
uglifier
|
uglifier (>= 1.3.0)
|
||||||
unicorn
|
unicorn
|
||||||
|
|
1
Rakefile
1
Rakefile
|
@ -1,4 +1,3 @@
|
||||||
#!/usr/bin/env rake
|
|
||||||
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
||||||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
||||||
|
|
||||||
|
|
|
@ -196,7 +196,7 @@ private
|
||||||
(@page - 1) * STORIES_PER_PAGE
|
(@page - 1) * STORIES_PER_PAGE
|
||||||
).order(
|
).order(
|
||||||
newest ? "stories.created_at DESC" : "hotness"
|
newest ? "stories.created_at DESC" : "hotness"
|
||||||
)
|
).to_a
|
||||||
|
|
||||||
show_more = false
|
show_more = false
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
class Story < ActiveRecord::Base
|
class Story < ActiveRecord::Base
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
has_many :taggings,
|
has_many :taggings,
|
||||||
:include => :tag,
|
|
||||||
:autosave => true
|
:autosave => true
|
||||||
has_many :comments
|
has_many :comments
|
||||||
has_many :tags, :through => :taggings
|
has_many :tags, :through => :taggings
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class User < ActiveRecord::Base
|
class User < ActiveRecord::Base
|
||||||
has_many :stories,
|
has_many :stories,
|
||||||
:include => :user
|
-> { includes :user }
|
||||||
has_many :comments
|
has_many :comments
|
||||||
has_many :sent_messages,
|
has_many :sent_messages,
|
||||||
:class_name => "Message",
|
:class_name => "Message",
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||||
|
load Gem.bin_path('bundler', 'bundle')
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
||||||
|
require_relative '../config/boot'
|
||||||
|
require 'rails/commands'
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
require_relative '../config/boot'
|
||||||
|
require 'rake'
|
||||||
|
Rake.application.run
|
|
@ -1,4 +1,4 @@
|
||||||
# This file is used by Rack-based servers to start the application.
|
# This file is used by Rack-based servers to start the application.
|
||||||
|
|
||||||
require ::File.expand_path('../config/environment', __FILE__)
|
require ::File.expand_path('../config/environment', __FILE__)
|
||||||
run Lobsters::Application
|
run Rails.application
|
||||||
|
|
|
@ -2,12 +2,9 @@ require File.expand_path('../boot', __FILE__)
|
||||||
|
|
||||||
require 'rails/all'
|
require 'rails/all'
|
||||||
|
|
||||||
if defined?(Bundler)
|
# Require the gems listed in Gemfile, including any gems
|
||||||
# If you precompile assets before deploying to production, use this line
|
# you've limited to :test, :development, or :production.
|
||||||
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
Bundler.require(:default, Rails.env)
|
||||||
# If you want your assets lazily compiled in production, use this line
|
|
||||||
# Bundler.require(:default, :assets, Rails.env)
|
|
||||||
end
|
|
||||||
|
|
||||||
module Lobsters
|
module Lobsters
|
||||||
class Application < Rails::Application
|
class Application < Rails::Application
|
||||||
|
@ -18,13 +15,6 @@ module Lobsters
|
||||||
# Custom directories with classes and modules you want to be autoloadable.
|
# Custom directories with classes and modules you want to be autoloadable.
|
||||||
config.autoload_paths += %W(#{config.root}/extras)
|
config.autoload_paths += %W(#{config.root}/extras)
|
||||||
|
|
||||||
# Only load the plugins named here, in the order given (default is alphabetical).
|
|
||||||
# :all can be used as a placeholder for all plugins not explicitly named.
|
|
||||||
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
|
||||||
|
|
||||||
# Activate observers that should always be running.
|
|
||||||
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
|
||||||
|
|
||||||
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
||||||
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
||||||
config.time_zone = 'Central Time (US & Canada)'
|
config.time_zone = 'Central Time (US & Canada)'
|
||||||
|
@ -33,28 +23,14 @@ module Lobsters
|
||||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||||
# config.i18n.default_locale = :de
|
# config.i18n.default_locale = :de
|
||||||
|
|
||||||
# Configure the default encoding used in templates for Ruby 1.9.
|
|
||||||
config.encoding = "utf-8"
|
|
||||||
|
|
||||||
# Configure sensitive parameters which will be filtered from the log file.
|
|
||||||
config.filter_parameters += [:password]
|
|
||||||
|
|
||||||
# Use SQL instead of Active Record's schema dumper when creating the database.
|
|
||||||
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
||||||
# like if you have constraints or database-specific column types
|
|
||||||
# config.active_record.schema_format = :sql
|
|
||||||
|
|
||||||
# Enforce whitelist mode for mass assignment.
|
# Enforce whitelist mode for mass assignment.
|
||||||
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
||||||
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
||||||
# parameters by using an attr_accessible or attr_protected declaration.
|
# parameters by using an attr_accessible or attr_protected declaration.
|
||||||
config.active_record.whitelist_attributes = true
|
config.active_record.whitelist_attributes = true
|
||||||
|
|
||||||
# Enable the asset pipeline
|
# Future Rails version will disable implicit joins, so we'll be prepared.
|
||||||
config.assets.enabled = true
|
config.active_record.disable_implicit_join_references = true
|
||||||
|
|
||||||
# Version of your assets, change this if you want to expire all your assets
|
|
||||||
config.assets.version = '1.0'
|
|
||||||
|
|
||||||
config.cache_store = :memory_store
|
config.cache_store = :memory_store
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rubygems'
|
|
||||||
|
|
||||||
# Set up gems listed in the Gemfile.
|
# Set up gems listed in the Gemfile.
|
||||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Load the rails application
|
# Load the Rails application.
|
||||||
require File.expand_path('../application', __FILE__)
|
require File.expand_path('../application', __FILE__)
|
||||||
|
|
||||||
# Initialize the rails application
|
# Initialize the Rails application.
|
||||||
Lobsters::Application.initialize!
|
Lobsters::Application.initialize!
|
||||||
|
|
|
@ -1,37 +1,32 @@
|
||||||
Lobsters::Application.configure do
|
Lobsters::Application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb
|
# Settings specified here will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
# In the development environment your application's code is reloaded on
|
# In the development environment your application's code is reloaded on
|
||||||
# every request. This slows down response time but is perfect for development
|
# every request. This slows down response time but is perfect for development
|
||||||
# since you don't have to restart the web server when you make code changes.
|
# since you don't have to restart the web server when you make code changes.
|
||||||
config.cache_classes = false
|
config.cache_classes = false
|
||||||
|
|
||||||
# Log error messages when you accidentally call methods on nil.
|
# Do not eager load code on boot.
|
||||||
config.whiny_nils = true
|
config.eager_load = false
|
||||||
|
|
||||||
# Show full error reports and disable caching
|
# Show full error reports and disable caching.
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
config.action_controller.perform_caching = false
|
config.action_controller.perform_caching = false
|
||||||
|
|
||||||
# Don't care if the mailer can't send
|
# Don't care if the mailer can't send.
|
||||||
config.action_mailer.raise_delivery_errors = false
|
config.action_mailer.raise_delivery_errors = false
|
||||||
|
|
||||||
# Print deprecation notices to the Rails logger
|
# Print deprecation notices to the Rails logger.
|
||||||
config.active_support.deprecation = :log
|
config.active_support.deprecation = :log
|
||||||
|
|
||||||
# Only use best-standards-support built into browsers
|
# Raise an error on page load if there are pending migrations
|
||||||
config.action_dispatch.best_standards_support = :builtin
|
config.active_record.migration_error = :page_load
|
||||||
|
|
||||||
# Raise exception on mass assignment protection for Active Record models
|
# Raise exception on mass assignment protection for Active Record models
|
||||||
config.active_record.mass_assignment_sanitizer = :strict
|
config.active_record.mass_assignment_sanitizer = :strict
|
||||||
|
|
||||||
# Log the query plan for queries taking more than this (works
|
# Debug mode disables concatenation and preprocessing of assets.
|
||||||
# with SQLite, MySQL, and PostgreSQL)
|
# This option may cause significant delays in view rendering with a large
|
||||||
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
# number of complex assets.
|
||||||
|
|
||||||
# Do not compress assets
|
|
||||||
config.assets.compress = false
|
|
||||||
|
|
||||||
# Expands the lines which load the assets
|
|
||||||
config.assets.debug = true
|
config.assets.debug = true
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,67 +1,80 @@
|
||||||
Lobsters::Application.configure do
|
Lobsters::Application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb
|
# Settings specified here will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
# Code is not reloaded between requests
|
# Code is not reloaded between requests.
|
||||||
config.cache_classes = true
|
config.cache_classes = true
|
||||||
|
|
||||||
# Full error reports are disabled and caching is turned on
|
# 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
|
||||||
|
|
||||||
|
# Full error reports are disabled and caching is turned on.
|
||||||
config.consider_all_requests_local = false
|
config.consider_all_requests_local = false
|
||||||
config.action_controller.perform_caching = true
|
config.action_controller.perform_caching = true
|
||||||
|
|
||||||
# Disable Rails's static asset server (Apache or nginx will already do this)
|
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
||||||
|
# Add `rack-cache` to your Gemfile before enabling this.
|
||||||
|
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
||||||
|
# config.action_dispatch.rack_cache = true
|
||||||
|
|
||||||
|
# Disable Rails's static asset server (Apache or nginx will already do this).
|
||||||
config.serve_static_assets = false
|
config.serve_static_assets = false
|
||||||
|
|
||||||
# Compress JavaScripts and CSS
|
# Compress JavaScripts and CSS.
|
||||||
config.assets.compress = true
|
config.assets.js_compressor = :uglifier
|
||||||
|
# config.assets.css_compressor = :sass
|
||||||
|
|
||||||
# fallback to assets pipeline if a precompiled asset is missed
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
||||||
config.assets.compile = false
|
config.assets.compile = false
|
||||||
|
|
||||||
# Generate digests for assets URLs
|
# Generate digests for assets URLs.
|
||||||
config.assets.digest = true
|
config.assets.digest = true
|
||||||
|
|
||||||
# Defaults to Rails.root.join("public/assets")
|
# Version of your assets, change this if you want to expire all your assets.
|
||||||
# config.assets.manifest = YOUR_PATH
|
config.assets.version = '1.0'
|
||||||
|
|
||||||
# Specifies the header that your server uses for sending files
|
# Specifies the header that your server uses for sending files.
|
||||||
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
||||||
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
||||||
|
|
||||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||||
config.force_ssl = true
|
config.force_ssl = true
|
||||||
|
|
||||||
# See everything in the log (default is :info)
|
# Set to :debug to see everything in the log.
|
||||||
# config.log_level = :debug
|
config.log_level = :info
|
||||||
|
|
||||||
# Prepend all log lines with the following tags
|
# Prepend all log lines with the following tags.
|
||||||
# config.log_tags = [ :subdomain, :uuid ]
|
# config.log_tags = [ :subdomain, :uuid ]
|
||||||
|
|
||||||
# Use a different logger for distributed setups
|
# Use a different logger for distributed setups.
|
||||||
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
||||||
|
|
||||||
# Use a different cache store in production
|
# Use a different cache store in production.
|
||||||
# config.cache_store = :mem_cache_store
|
# config.cache_store = :mem_cache_store
|
||||||
|
|
||||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||||
# config.action_controller.asset_host = "http://assets.example.com"
|
# config.action_controller.asset_host = "http://assets.example.com"
|
||||||
|
|
||||||
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
# Precompile additional assets.
|
||||||
|
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
||||||
# config.assets.precompile += %w( search.js )
|
# config.assets.precompile += %w( search.js )
|
||||||
|
|
||||||
# Disable delivery errors, bad email addresses will be ignored
|
# Ignore bad email addresses and do not raise email delivery errors.
|
||||||
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
||||||
# config.action_mailer.raise_delivery_errors = false
|
# config.action_mailer.raise_delivery_errors = false
|
||||||
|
|
||||||
# Enable threaded mode
|
|
||||||
# config.threadsafe!
|
|
||||||
|
|
||||||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||||
# the I18n.default_locale when a translation can not be found)
|
# the I18n.default_locale when a translation can not be found).
|
||||||
config.i18n.fallbacks = true
|
config.i18n.fallbacks = true
|
||||||
|
|
||||||
# Send deprecation notices to registered listeners
|
# Send deprecation notices to registered listeners.
|
||||||
config.active_support.deprecation = :notify
|
config.active_support.deprecation = :notify
|
||||||
|
|
||||||
# Log the query plan for queries taking more than this (works
|
# Disable automatic flushing of the log to improve performance.
|
||||||
# with SQLite, MySQL, and PostgreSQL)
|
# config.autoflush_log = false
|
||||||
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
|
||||||
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
||||||
|
config.log_formatter = ::Logger::Formatter.new
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Lobsters::Application.configure do
|
Lobsters::Application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb
|
# Settings specified here will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
# The test environment is used exclusively to run your application's
|
# The test environment is used exclusively to run your application's
|
||||||
# test suite. You never need to work with it otherwise. Remember that
|
# test suite. You never need to work with it otherwise. Remember that
|
||||||
|
@ -7,31 +7,33 @@ Lobsters::Application.configure do
|
||||||
# and recreated between test runs. Don't rely on the data there!
|
# and recreated between test runs. Don't rely on the data there!
|
||||||
config.cache_classes = true
|
config.cache_classes = true
|
||||||
|
|
||||||
# Configure static asset server for tests with Cache-Control for performance
|
# Do not eager load code on boot. This avoids loading your whole application
|
||||||
config.serve_static_assets = true
|
# just for the purpose of running a single test. If you are using a tool that
|
||||||
|
# preloads Rails for running tests, you may have to set it to true.
|
||||||
|
config.eager_load = false
|
||||||
|
|
||||||
|
# Configure static asset server for tests with Cache-Control for performance.
|
||||||
|
config.serve_static_assets = true
|
||||||
config.static_cache_control = "public, max-age=3600"
|
config.static_cache_control = "public, max-age=3600"
|
||||||
|
|
||||||
# Log error messages when you accidentally call methods on nil
|
# Show full error reports and disable caching.
|
||||||
config.whiny_nils = true
|
|
||||||
|
|
||||||
# Show full error reports and disable caching
|
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
config.action_controller.perform_caching = false
|
config.action_controller.perform_caching = false
|
||||||
|
|
||||||
# Raise exceptions instead of rendering exception templates
|
# Raise exceptions instead of rendering exception templates.
|
||||||
config.action_dispatch.show_exceptions = false
|
config.action_dispatch.show_exceptions = false
|
||||||
|
|
||||||
# Disable request forgery protection in test environment
|
# Disable request forgery protection in test environment.
|
||||||
config.action_controller.allow_forgery_protection = false
|
config.action_controller.allow_forgery_protection = false
|
||||||
|
|
||||||
# Tell Action Mailer not to deliver emails to the real world.
|
# Tell Action Mailer not to deliver emails to the real world.
|
||||||
# The :test delivery method accumulates sent emails in the
|
# The :test delivery method accumulates sent emails in the
|
||||||
# ActionMailer::Base.deliveries array.
|
# ActionMailer::Base.deliveries array.
|
||||||
config.action_mailer.delivery_method = :test
|
config.action_mailer.delivery_method = :test
|
||||||
|
|
||||||
# Raise exception on mass assignment protection for Active Record models
|
# Raise exception on mass assignment protection for Active Record models.
|
||||||
config.active_record.mass_assignment_sanitizer = :strict
|
config.active_record.mass_assignment_sanitizer = :strict
|
||||||
|
|
||||||
# Print deprecation notices to the stderr
|
# Print deprecation notices to the stderr.
|
||||||
config.active_support.deprecation = :stderr
|
config.active_support.deprecation = :stderr
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
|
# Configure sensitive parameters which will be filtered from the log file.
|
||||||
|
Rails.application.config.filter_parameters += [:password]
|
|
@ -1,15 +1,16 @@
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
# Add new inflection rules using the following format
|
# Add new inflection rules using the following format. Inflections
|
||||||
# (all these examples are active by default):
|
# are locale specific, and you may define rules for as many different
|
||||||
# ActiveSupport::Inflector.inflections do |inflect|
|
# locales as you wish. All of these examples are active by default:
|
||||||
|
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
# inflect.plural /^(ox)$/i, '\1en'
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
# inflect.singular /^(ox)en/i, '\1'
|
||||||
# inflect.irregular 'person', 'people'
|
# inflect.irregular 'person', 'people'
|
||||||
# inflect.uncountable %w( fish sheep )
|
# inflect.uncountable %w( fish sheep )
|
||||||
# end
|
# end
|
||||||
#
|
|
||||||
# These inflection rules are supported but not enabled by default:
|
# These inflection rules are supported but not enabled by default:
|
||||||
# ActiveSupport::Inflector.inflections do |inflect|
|
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||||
# inflect.acronym 'RESTful'
|
# inflect.acronym 'RESTful'
|
||||||
# end
|
# end
|
||||||
|
|
|
@ -2,8 +2,3 @@
|
||||||
|
|
||||||
Lobsters::Application.config.session_store :cookie_store,
|
Lobsters::Application.config.session_store :cookie_store,
|
||||||
key: 'lobster_trap', expire_after: 1.month
|
key: 'lobster_trap', expire_after: 1.month
|
||||||
|
|
||||||
# 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 "rails generate session_migration")
|
|
||||||
# Lobsters::Application.config.session_store :active_record_store
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
#
|
|
||||||
# This file contains settings for ActionController::ParamsWrapper which
|
# This file contains settings for ActionController::ParamsWrapper which
|
||||||
# is enabled by default.
|
# is enabled by default.
|
||||||
|
|
||||||
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
||||||
ActiveSupport.on_load(:action_controller) do
|
ActiveSupport.on_load(:action_controller) do
|
||||||
wrap_parameters format: [:json]
|
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Disable root element in JSON by default.
|
# To enable root element in JSON for ActiveRecord objects.
|
||||||
ActiveSupport.on_load(:active_record) do
|
# ActiveSupport.on_load(:active_record) do
|
||||||
self.include_root_in_json = false
|
# self.include_root_in_json = true
|
||||||
end
|
# end
|
||||||
|
|
|
@ -23,15 +23,15 @@ Lobsters::Application.routes.draw do
|
||||||
post "/signup" => "signup#signup"
|
post "/signup" => "signup#signup"
|
||||||
get "/signup/invite" => "signup#invite"
|
get "/signup/invite" => "signup#invite"
|
||||||
|
|
||||||
match "/login/forgot_password" => "login#forgot_password",
|
get "/login/forgot_password" => "login#forgot_password",
|
||||||
:as => "forgot_password"
|
:as => "forgot_password"
|
||||||
post "/login/reset_password" => "login#reset_password",
|
post "/login/reset_password" => "login#reset_password",
|
||||||
:as => "reset_password"
|
:as => "reset_password"
|
||||||
match "/login/set_new_password" => "login#set_new_password",
|
match "/login/set_new_password" => "login#set_new_password",
|
||||||
:as => "set_new_password"
|
:as => "set_new_password", :via => [:get, :post]
|
||||||
|
|
||||||
match "/t/:tag" => "home#tagged", :as => "tag"
|
get "/t/:tag" => "home#tagged", :as => "tag"
|
||||||
match "/t/:tag/page/:page" => "home#tagged"
|
get "/t/:tag/page/:page" => "home#tagged"
|
||||||
|
|
||||||
get "/search" => "search#index"
|
get "/search" => "search#index"
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ class CreateInvitations < ActiveRecord::Migration
|
||||||
t.integer :user_id
|
t.integer :user_id
|
||||||
t.string :email
|
t.string :email
|
||||||
t.string :code
|
t.string :code
|
||||||
t.timestamps
|
t.timestamps :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
add_column :users, :invited_by_user_id, :integer
|
add_column :users, :invited_by_user_id, :integer
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class UserFilter < ActiveRecord::Migration
|
class UserFilter < ActiveRecord::Migration
|
||||||
def up
|
def up
|
||||||
create_table :tag_filters do |t|
|
create_table :tag_filters do |t|
|
||||||
t.timestamps
|
t.timestamps :null => false
|
||||||
t.integer :user_id
|
t.integer :user_id
|
||||||
t.integer :tag_id
|
t.integer :tag_id
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ class AddModerationLog < ActiveRecord::Migration
|
||||||
add_column "users", "is_moderator", :boolean, :default => false
|
add_column "users", "is_moderator", :boolean, :default => false
|
||||||
|
|
||||||
create_table "moderations" do |t|
|
create_table "moderations" do |t|
|
||||||
t.timestamps
|
t.timestamps :null => false
|
||||||
t.integer "moderator_user_id"
|
t.integer "moderator_user_id"
|
||||||
t.integer "story_id"
|
t.integer "story_id"
|
||||||
t.integer "comment_id"
|
t.integer "comment_id"
|
||||||
|
|
|
@ -7,7 +7,7 @@ class AddInvitationRequests < ActiveRecord::Migration
|
||||||
t.string :name
|
t.string :name
|
||||||
t.text :memo
|
t.text :memo
|
||||||
t.string :ip_address
|
t.string :ip_address
|
||||||
t.timestamps
|
t.timestamps :null => false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#!/usr/bin/env ruby
|
|
||||||
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
|
||||||
|
|
||||||
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
|
||||||
require File.expand_path('../../config/boot', __FILE__)
|
|
||||||
require 'rails/commands'
|
|
Loading…
Reference in New Issue