diff --git a/.gitignore b/.gitignore index 267f8bf..2347573 100644 --- a/.gitignore +++ b/.gitignore @@ -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 # 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 # Ignore the default SQLite database. /db/*.sqlite3 +/db/*.sqlite3-journal /db/sphinx # Ignore all logfiles and tempfiles. diff --git a/Gemfile b/Gemfile index 36a8f3b..5b35b33 100644 --- a/Gemfile +++ b/Gemfile @@ -1,26 +1,29 @@ 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: -# gem "rails", :git => "git://github.com/rails/rails.git" +# Use Rails3-style mass assignment security +gem "protected_attributes" -gem "mysql2", :git => "git://github.com/brianmario/mysql2.git" - -gem "bcrypt-ruby", "3.0.0" +# Use Uglifier as compressor for JavaScript assets +gem "uglifier", ">= 1.3.0" +# Use jquery as the JavaScript library gem "jquery-rails" gem "dynamic_form" # use old version that doesn't have tinder bullshit gem "exception_notification", "2.6.1" -gem "unicorn" +# Use ActiveModel has_secure_password +gem "bcrypt-ruby", "~> 3.1.2" -# for asset compilation -gem "uglifier" +# Use unicorn as the app server +gem "unicorn" gem "nokogiri" gem "htmlentities" diff --git a/Gemfile.lock b/Gemfile.lock index 712fe66..da84eca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,42 +1,34 @@ -GIT - remote: git://github.com/brianmario/mysql2.git - revision: a9787cbb88f18d12f0b5c370c519d077ad68c862 - specs: - mysql2 (0.3.14) - GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.16) - actionpack (= 3.2.16) + actionmailer (4.0.2) + actionpack (= 4.0.2) mail (~> 2.5.4) - actionpack (3.2.16) - activemodel (= 3.2.16) - activesupport (= 3.2.16) - builder (~> 3.0.0) + actionpack (4.0.2) + activesupport (= 4.0.2) + builder (~> 3.1.0) erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.5) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.16) - activesupport (= 3.2.16) - builder (~> 3.0.0) - activerecord (3.2.16) - activemodel (= 3.2.16) - activesupport (= 3.2.16) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.16) - activemodel (= 3.2.16) - activesupport (= 3.2.16) - activesupport (3.2.16) + rack (~> 1.5.2) + rack-test (~> 0.6.2) + activemodel (4.0.2) + activesupport (= 4.0.2) + builder (~> 3.1.0) + activerecord (4.0.2) + activemodel (= 4.0.2) + activerecord-deprecated_finders (~> 1.0.2) + activesupport (= 4.0.2) + arel (~> 4.0.0) + activerecord-deprecated_finders (1.0.3) + activesupport (4.0.2) i18n (~> 0.6, >= 0.6.4) - multi_json (~> 1.0) - arel (3.0.3) - bcrypt-ruby (3.0.0) - builder (3.0.4) + minitest (~> 4.2) + multi_json (~> 1.3) + thread_safe (~> 0.1) + 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) dynamic_form (1.1.4) erubis (2.7.0) @@ -45,8 +37,7 @@ GEM execjs (2.0.2) hike (1.2.3) htmlentities (4.3.1) - i18n (0.6.8) - journey (1.0.4) + i18n (0.6.9) jquery-rails (3.0.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) @@ -58,38 +49,34 @@ GEM treetop (~> 1.4.8) mime-types (1.25.1) mini_portile (0.5.2) + minitest (4.7.5) multi_json (1.8.2) - nokogiri (1.6.0) + mysql2 (0.3.14) + nokogiri (1.6.1) mini_portile (~> 0.5.0) oauth (0.4.7) polyglot (0.3.3) - rack (1.4.5) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.3) - rack + protected_attributes (1.0.5) + activemodel (>= 4.0.1, < 5.0) + rack (1.5.2) rack-test (0.6.2) rack (>= 1.0) - rails (3.2.16) - actionmailer (= 3.2.16) - actionpack (= 3.2.16) - activerecord (= 3.2.16) - activeresource (= 3.2.16) - activesupport (= 3.2.16) - bundler (~> 1.0) - railties (= 3.2.16) - railties (3.2.16) - actionpack (= 3.2.16) - activesupport (= 3.2.16) - rack-ssl (~> 1.3.2) + rails (4.0.2) + actionmailer (= 4.0.2) + actionpack (= 4.0.2) + activerecord (= 4.0.2) + activesupport (= 4.0.2) + bundler (>= 1.3.0, < 2.0) + railties (= 4.0.2) + sprockets-rails (~> 2.0.0) + railties (4.0.2) + actionpack (= 4.0.2) + activesupport (= 4.0.2) rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) + thor (>= 0.18.1, < 2.0) raindrops (0.12.0) - rake (10.0.3) + rake (10.1.1) rdiscount (2.1.7) - rdoc (3.12.2) - json (~> 1.4) riddle (1.5.9) rspec-core (2.14.7) rspec-expectations (2.14.4) @@ -102,23 +89,29 @@ GEM rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) rspec-mocks (~> 2.14.0) - sprockets (2.2.2) + sprockets (2.10.1) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.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) thinking-sphinx (2.0.12) activerecord (>= 3.0.3) builder (>= 2.1.2) riddle (>= 1.5.2) thor (0.18.1) + thread_safe (0.1.3) + atomic tilt (1.4.1) treetop (1.4.15) polyglot polyglot (>= 0.3.1) tzinfo (0.3.38) - uglifier (2.3.2) + uglifier (2.4.0) execjs (>= 0.3.0) json (>= 1.8.0) unicorn (4.7.0) @@ -130,21 +123,21 @@ PLATFORMS ruby DEPENDENCIES - bcrypt-ruby (= 3.0.0) + bcrypt-ruby (~> 3.1.2) dynamic_form exception_notification (= 2.6.1) htmlentities jquery-rails machinist mail - mysql2! + mysql2 (>= 0.3.14) nokogiri oauth - rails (= 3.2.16) - rake (= 10.0.3) + protected_attributes + rails (= 4.0.2) rdiscount rspec-rails (~> 2.6) sqlite3 thinking-sphinx (= 2.0.12) - uglifier + uglifier (>= 1.3.0) unicorn diff --git a/Rakefile b/Rakefile index 6408ab5..3394d95 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,3 @@ -#!/usr/bin/env 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. diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 5ac62e2..f59c8ae 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -196,7 +196,7 @@ private (@page - 1) * STORIES_PER_PAGE ).order( newest ? "stories.created_at DESC" : "hotness" - ) + ).to_a show_more = false diff --git a/app/models/story.rb b/app/models/story.rb index 094896f..bc6b031 100644 --- a/app/models/story.rb +++ b/app/models/story.rb @@ -1,7 +1,6 @@ class Story < ActiveRecord::Base belongs_to :user has_many :taggings, - :include => :tag, :autosave => true has_many :comments has_many :tags, :through => :taggings diff --git a/app/models/user.rb b/app/models/user.rb index 3ecb7d0..d2fb92a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,6 +1,6 @@ class User < ActiveRecord::Base has_many :stories, - :include => :user + -> { includes :user } has_many :comments has_many :sent_messages, :class_name => "Message", diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000..66e9889 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..728cd85 --- /dev/null +++ b/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..1724048 --- /dev/null +++ b/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/config.ru b/config.ru index 2d27577..5bc2a61 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,4 @@ # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) -run Lobsters::Application +run Rails.application diff --git a/config/application.rb b/config/application.rb index d6fc54a..e3f0554 100644 --- a/config/application.rb +++ b/config/application.rb @@ -2,12 +2,9 @@ require File.expand_path('../boot', __FILE__) require 'rails/all' -if defined?(Bundler) - # If you precompile assets before deploying to production, use this line - Bundler.require(*Rails.groups(:assets => %w(development test))) - # If you want your assets lazily compiled in production, use this line - # Bundler.require(:default, :assets, Rails.env) -end +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(:default, Rails.env) module Lobsters class Application < Rails::Application @@ -18,13 +15,6 @@ module Lobsters # Custom directories with classes and modules you want to be autoloadable. 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. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 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.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. # 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 # parameters by using an attr_accessible or attr_protected declaration. config.active_record.whitelist_attributes = true - # Enable the asset pipeline - config.assets.enabled = true - - # Version of your assets, change this if you want to expire all your assets - config.assets.version = '1.0' + # Future Rails version will disable implicit joins, so we'll be prepared. + config.active_record.disable_implicit_join_references = true config.cache_store = :memory_store end diff --git a/config/boot.rb b/config/boot.rb index 4489e58..3596736 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,5 +1,3 @@ -require 'rubygems' - # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) diff --git a/config/environment.rb b/config/environment.rb index 975c02b..18f3fb9 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,5 +1,5 @@ -# Load the rails application +# Load the Rails application. require File.expand_path('../application', __FILE__) -# Initialize the rails application +# Initialize the Rails application. Lobsters::Application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index 430e967..de773c7 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,37 +1,32 @@ 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 # 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. config.cache_classes = false - # 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 + # Show full error reports and disable caching. config.consider_all_requests_local = true 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 - # Print deprecation notices to the Rails logger + # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log - # Only use best-standards-support built into browsers - config.action_dispatch.best_standards_support = :builtin + # Raise an error on page load if there are pending migrations + config.active_record.migration_error = :page_load # 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 + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. config.assets.debug = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index d365c5d..6ee45dd 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,67 +1,80 @@ 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 - # 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.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 - # Compress JavaScripts and CSS - config.assets.compress = true + # Compress JavaScripts and CSS. + 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 - # Generate digests for assets URLs + # Generate digests for assets URLs. config.assets.digest = true - # Defaults to Rails.root.join("public/assets") - # config.assets.manifest = YOUR_PATH + # Version of your assets, change this if you want to expire all your assets. + 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-Accel-Redirect' # for nginx # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. config.force_ssl = true - # See everything in the log (default is :info) - # config.log_level = :debug + # Set to :debug to see everything in the log. + 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 ] - # Use a different logger for distributed setups + # Use a different logger for distributed setups. # 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 - # 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" - # 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 ) - # 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 - # Enable threaded mode - # config.threadsafe! - # 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 - # Send deprecation notices to registered listeners + # 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 + # Disable automatic flushing of the log to improve performance. + # config.autoflush_log = false + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new end diff --git a/config/environments/test.rb b/config/environments/test.rb index 05105ca..04537e5 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,5 +1,5 @@ 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 # 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! config.cache_classes = true - # Configure static asset server for tests with Cache-Control for performance - config.serve_static_assets = true + # Do not eager load code on boot. This avoids loading your whole application + # 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" - # Log error messages when you accidentally call methods on nil - config.whiny_nils = true - - # Show full error reports and disable caching + # Show full error reports and disable caching. config.consider_all_requests_local = true 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 - # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. 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 - # Print deprecation notices to the stderr + # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr end diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/config/initializers/filter_parameter_logging.rb @@ -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] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 5d8d9be..ac033bf 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,15 +1,16 @@ # Be sure to restart your server when you modify this file. -# Add new inflection rules using the following format -# (all these examples are active by default): -# ActiveSupport::Inflector.inflections do |inflect| +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| # inflect.plural /^(ox)$/i, '\1en' # inflect.singular /^(ox)en/i, '\1' # inflect.irregular 'person', 'people' # inflect.uncountable %w( fish sheep ) # end -# + # These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections do |inflect| +# ActiveSupport::Inflector.inflections(:en) do |inflect| # inflect.acronym 'RESTful' # end diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index adb3434..cab6eb2 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -2,8 +2,3 @@ Lobsters::Application.config.session_store :cookie_store, 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 diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index 999df20..33725e9 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -1,14 +1,14 @@ # Be sure to restart your server when you modify this file. -# + # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] + wrap_parameters format: [:json] if respond_to?(:wrap_parameters) end -# Disable root element in JSON by default. -ActiveSupport.on_load(:active_record) do - self.include_root_in_json = false -end +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/config/routes.rb b/config/routes.rb index 2bd5f05..26a432a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -23,15 +23,15 @@ Lobsters::Application.routes.draw do post "/signup" => "signup#signup" get "/signup/invite" => "signup#invite" - match "/login/forgot_password" => "login#forgot_password", + get "/login/forgot_password" => "login#forgot_password", :as => "forgot_password" post "/login/reset_password" => "login#reset_password", :as => "reset_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" - match "/t/:tag/page/:page" => "home#tagged" + get "/t/:tag" => "home#tagged", :as => "tag" + get "/t/:tag/page/:page" => "home#tagged" get "/search" => "search#index" diff --git a/db/migrate/20120701154453_create_invitations.rb b/db/migrate/20120701154453_create_invitations.rb index f571af0..8ad03ce 100644 --- a/db/migrate/20120701154453_create_invitations.rb +++ b/db/migrate/20120701154453_create_invitations.rb @@ -4,7 +4,7 @@ class CreateInvitations < ActiveRecord::Migration t.integer :user_id t.string :email t.string :code - t.timestamps + t.timestamps :null => false end add_column :users, :invited_by_user_id, :integer diff --git a/db/migrate/20120704025956_user_filter.rb b/db/migrate/20120704025956_user_filter.rb index f4133b3..0fbc78b 100644 --- a/db/migrate/20120704025956_user_filter.rb +++ b/db/migrate/20120704025956_user_filter.rb @@ -1,7 +1,7 @@ class UserFilter < ActiveRecord::Migration def up create_table :tag_filters do |t| - t.timestamps + t.timestamps :null => false t.integer :user_id t.integer :tag_id end diff --git a/db/migrate/20120902143549_add_moderation_log.rb b/db/migrate/20120902143549_add_moderation_log.rb index 33ef6c0..7859942 100644 --- a/db/migrate/20120902143549_add_moderation_log.rb +++ b/db/migrate/20120902143549_add_moderation_log.rb @@ -3,7 +3,7 @@ class AddModerationLog < ActiveRecord::Migration add_column "users", "is_moderator", :boolean, :default => false create_table "moderations" do |t| - t.timestamps + t.timestamps :null => false t.integer "moderator_user_id" t.integer "story_id" t.integer "comment_id" diff --git a/db/migrate/20131018201413_add_invitation_requests.rb b/db/migrate/20131018201413_add_invitation_requests.rb index 20c99be..cd7b034 100644 --- a/db/migrate/20131018201413_add_invitation_requests.rb +++ b/db/migrate/20131018201413_add_invitation_requests.rb @@ -7,7 +7,7 @@ class AddInvitationRequests < ActiveRecord::Migration t.string :name t.text :memo t.string :ip_address - t.timestamps + t.timestamps :null => false end end diff --git a/vendor/plugins/.gitkeep b/log/.keep similarity index 100% rename from vendor/plugins/.gitkeep rename to log/.keep diff --git a/script/rails b/script/rails deleted file mode 100755 index f8da2cf..0000000 --- a/script/rails +++ /dev/null @@ -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'