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
| backend default { | |
| .host = "127.0.0.1"; | |
| .port = "8000"; | |
| } | |
| sub vcl_recv { | |
| if (req.request != "GET" | |
| && req.request != "HEAD") { | |
| return (pass); | |
| } |
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 Devise | |
| module Models | |
| # Authenticable module. Holds common settings for authentication. | |
| # | |
| # Configuration: | |
| # | |
| # You can overwrite configuration values by setting in globally in Devise, | |
| # using devise method or overwriting the respective instance method. | |
| # | |
| # authentication_keys: parameters used for authentication. By default [:email]. |
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
| define_index do | |
| ... | |
| # it should be this | |
| indexes genres(:name) | |
| # indexes special_tags(:name), :as => 'special_tags' | |
| # and the ugly way to get special_tags working | |
| indexes "GROUP_CONCAT(DISTINCT `special_tags_performances`.`name` SEPARATOR ' ')", :as => 'special_tags' | |
| set_property :custom_joins => "LEFT OUTER JOIN `taggings` special_tags_performances_join ON (`performances`.`id` = `special_tags_performances_join`.`taggable_id` AND `special_tags_performances_join`.`taggable_type` = 'Performance') LEFT OUTER JOIN `tags` special_tags_performances ON (`special_tags_performances`.`id` = `special_tags_performances_join`.`tag_id`) AND `special_tags_performances`.`context` = 'special_tags'" |
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
| # Conditions in has_many :through behave differently for joins and includes | |
| # Here is an example using Tagging | |
| # The important thing to note from these two models is that the 'context' | |
| # of the Tag is kept in the Tag model and not the Tagging | |
| # (acts-as-taggable-on keeps it in the Tagging model) | |
| class Tag < ActiveRecord::Base | |
| has_many :taggings, :dependent => :delete_all |
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 'active_support/core_ext/hash/keys' | |
| require 'active_support/core_ext/class/attribute' | |
| module ActiveModel | |
| class MissingAttributeError < NoMethodError | |
| end | |
| # == Active Model Attribute Methods | |
| # | |
| # <tt>ActiveModel::AttributeMethods</tt> provides a way to add prefixes and suffixes | |
| # to your methods as well as handling the creation of Active Record like class methods |
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 BetaSignupMailer < ActionMailer::Base | |
| default :from => "no-reply@test.com" | |
| def send_invite(beta_signup) | |
| @beta_signup = beta_signup | |
| mail_options = { | |
| :to => @beta_signup.email, | |
| :bcc => 'api@test.com', | |
| :subject => "Welcome to the Beta program" |
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
| Example::Application.routes.draw do |map| | |
| constraints :protocol => "https://" do | |
| get "hi_there", :to => "pages#show", :as => "hi_there" | |
| end | |
| end | |
| >> app.get('http://www.example.com') | |
| >> (ignore the output) | |
| >> app.hi_there_url | |
| => "http://www.example.com/hi_there" |
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
| source :rubygems | |
| gemspec |
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
| /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:27:in `setup': You have already activated gemcutter 0.5.0, but your Gemfile requires gemcutter 0.6.1. Consider using bundle exec. (Gem::LoadError) | |
| from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/spec_set.rb:12:in `each' | |
| from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/spec_set.rb:12:in `each' | |
| from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/runtime.rb:17:in `setup' | |
| from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler.rb:95:in `setup' | |
| from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/cli.rb:292:in `exec' | |
| from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/vendor/thor/task.rb:22:in `send' | |
| from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/vendor/thor/task.rb:22:in `run' | |
| from /opt/local/lib/ruby/gems/1.8/gems/bundler-1.0.0.rc.5/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' | |
| from /o |
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
| # - TS related capistrano tasks | |
| require "vendor/plugins/thinking-sphinx/lib/thinking_sphinx/deploy/capistrano" | |
| require 'new_relic/recipes' | |
| set :stages, %w(staging production) | |
| set :default_stage, "staging" | |
| require 'capistrano/ext/multistage' | |
| # Global deployment information |