This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a= 'hoge' | |
a.hoge? # NoMethodError: undefined method `hoge?' for "hoge":String | |
a = ActiveSupport::StringInquirer.new('hoge') | |
a.hoge? # => true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devise :users | |
resources :events do | |
resource :attendances, only: [:create, :destroy] # 参加処理 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'rspec/autorun' | |
# Load all railties files | |
Rails.application.railties.to_a { |r| r.eager_load! } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'rinku' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb | |
index e3f861f..b7cac75 100644 | |
--- a/config/initializers/session_store.rb | |
+++ b/config/initializers/session_store.rb | |
@@ -1,3 +1,3 @@ | |
# Be sure to restart your server when you modify this file. | |
-HogeCo::Application.config.session_store :encrypted_cookie_store, key: '_hoge_co_session' | |
+HogeCo::Application.config.session_store :cookie_store, key: '_hoge_co_session' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . ! \( -path "./.git*" -or -path "./tmp*" -or -path "*assets*" -or -path "*log*" -or -path "*doc*" \) -type f -print0 | xargs -0 ruby -i -p -e '$_.gsub! %q{hoge}, %q{fugo}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'guard-rails-assets' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rake routes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'open-uri' | |
storage = Fog::Storage.new( | |
provider: 'AWS', | |
aws_access_key_id:ENV['AWS_S3_KEY_ID'], | |
aws_secret_access_key:ENV['AWS_S3_SECRET_KEY'], | |
region: ENV['AWS_REGION'] | |
) | |
bucket = storage.directories.get(ENV['AWS_S3_BUCKET']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ControllerMacros | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def request_should_be_success method, path, params = {} | |
describe "#{method.to_s.upcase} '#{path.to_s}'" do | |
before do | |
send method, path, params |