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
heroku run printenv | |
TERM=xterm-256color | |
[email protected] | |
RACK_ENV=production | |
COLUMNS=178 | |
DYNO=run.7767 | |
PATH=/app/bin:/app/vendor/bundle/bin:/app/vendor/bundle/ruby/2.3.0/bin:/usr/local/bin:/usr/bin:/bin | |
SECRET_KEY_BASE=65532e343c197ebe55e22ad2ae00c37b94529573c74cf344774217e5a35f8f884810a2e3a370bf28f6319d7c079b7729a19ba7eecfb72c5110a1b055f9a4f6f2 |
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
Rails.application.routes.draw do | |
# not_authenticated do | |
# get 'some/route' | |
# end | |
# | |
# authenticated do | |
# get 'some/route' | |
# | |
# current_user -> (u) { u.webmaster? } do |
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 'spec_helper' | |
# old code | |
# RSpec.describe "Feature 1" do | |
# | |
# end | |
# new code | |
Foo.rspec_describe "Feature 1", __PATH__ do | |
# |
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
<Stream status | |
Format status | |
</Stream> | |
<Redirect s> | |
URL status | |
</Redirect> | |
# <Redirect index.html> | |
# URL hubby.mjpg |
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
class ApplicationController | |
def current_user_decorator | |
@cud ||= current_user ? CurrentUserDecorator.new(current_user) : NullCurrentUserDecorator.new | |
end | |
# or this | |
def current_user | |
if signed_in? | |
super | |
else |
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
class Model | |
validates_inclusion_of :grade, in: :valid_grades | |
def valid_grades | |
[1,2,3,4,5] | |
end | |
end | |
## view | |
<%= f.select_tag, :grade, @model.valid_grades %> |
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
ActiveRecord::Schema.define(version: 20150803041107) do | |
# These are extensions that must be enabled in order to support this database | |
enable_extension "plpgsql" | |
create_table "access_tokens", force: :cascade do |t| | |
t.integer "user_id" | |
t.string "user_agent_string" | |
t.string "access_token" | |
t.string "ip" |
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
# http://candland.net/2012/04/17/rails-routes-used-in-an-isolated-engine/ | |
module Hello | |
module ApplicationHelper | |
def method_missing method, *args, &block | |
# puts "LOOKING FOR ROUTES #{method}" | |
return super if not method.to_s.end_with?('_path', '_url') | |
return super if not main_app.respond_to?(method) | |
main_app.send(method, *args) | |
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 'spec_helper' | |
RSpec.describe Ticketing::ValueObjects::Coupon do | |
describe "Instance Methods" do | |
# subject do | |
# # Given a VO | |
# Ticketing::ValueObjects::Coupon.new | |
# end |