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 ApplicationHelper | |
| def event_autolink(event_parts) | |
| event_parts.map do |part| | |
| case part.content | |
| when Hash | |
| link_to part.content['name'], send("admin_#{part.content['class_name'].underscore}_path", part.content['id']) | |
| else | |
| part.content | |
| 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
| module StrongAdmin | |
| extend ActiveSupport::Concern | |
| def initialize | |
| @instance_name = active_admin_config.resource_name.downcase | |
| @klass = active_admin_config.resource_name.constantize | |
| @column_names = @klass.columns.map do |column| | |
| unless [:id, :created_at, :updated_at].include?(column.name.to_sym) |
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
| Connecting to database specified by database.yml | |
| (2.0ms) ALTER TABLE "answers" DISABLE TRIGGER ALL;ALTER TABLE "admin_users" DISABLE TRIGGER ALL;ALTER TABLE "question_groups" DISABLE TRIGGER ALL;ALTER TABLE "subjects" DISABLE TRIGGER ALL;ALTER TABLE "active_admin_comments" DISABLE TRIGGER ALL;ALTER TABLE "users" DISABLE TRIGGER ALL;ALTER TABLE "assessments" DISABLE TRIGGER ALL;ALTER TABLE "billings" DISABLE TRIGGER ALL;ALTER TABLE "free_response_sections" DISABLE TRIGGER ALL;ALTER TABLE "friendly_id_slugs" DISABLE TRIGGER ALL;ALTER TABLE "lessons" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "pages" DISABLE TRIGGER ALL;ALTER TABLE "contacts" DISABLE TRIGGER ALL;ALTER TABLE "assessment_items" DISABLE TRIGGER ALL;ALTER TABLE "packages" DISABLE TRIGGER ALL;ALTER TABLE "settings" DISABLE TRIGGER ALL;ALTER TABLE "shippings" DISABLE TRIGGER ALL;ALTER TABLE "questions" DISABLE TRIGGER ALL;ALTER TABLE "transactions" DISABLE TRIGGER ALL;ALTER TABLE "user_assessment_responses" |
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 'spork' | |
| Spork.prefork do | |
| ENV["RAILS_ENV"] ||= 'test' | |
| require File.expand_path("../../config/environment", __FILE__) | |
| require 'rspec/rails' | |
| require 'capybara/rspec' | |
| require 'database_cleaner' | |
| Spork.trap_method(Rails::Application, :reload_routes!) | |
| Spork.trap_method(Rails::Application::RoutesReloader, :reload!) |
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
| # Redis configuration file example | |
| # Note on units: when memory size is needed, it is possible to specifiy | |
| # it in the usual form of 1k 5GB 4M and so forth: | |
| # | |
| # 1k => 1000 bytes | |
| # 1kb => 1024 bytes | |
| # 1m => 1000000 bytes | |
| # 1mb => 1024*1024 bytes | |
| # 1g => 1000000000 bytes |
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
| $("form#whatever").submit(function() { | |
| $(this).submit(function() { | |
| return false; | |
| }); | |
| return 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
| if @result.credit_card_verification | |
| @account.transactions.build( | |
| :approved => false, | |
| :avs_error_response_code => @result.credit_card_verification.avs_error_response_code, | |
| :avs_postal_code_response_code => @result.credit_card_verification.avs_postal_code_response_code, | |
| :avs_street_address_response_code => @result.credit_card_verification.avs_street_address_response_code, | |
| :cvv_response_code => @result.credit_card_verification.cvv_response_code, | |
| :gateway_rejection_reason => @result.credit_card_verification.gateway_rejection_reason, | |
| :processor_response_code => @result.credit_card_verification.processor_response_code, | |
| :processor_response_text => @result.credit_card_verification.processor_response_text, |
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 < ActionController::Base | |
| before_filter :fix_accept_header | |
| protected | |
| def fix_accept_header | |
| request.format = :html unless Mime::SET.map(&:symbol).include?(request.format.to_sym) | |
| 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 'capistrano/ext/multistage' | |
| require "bundler/capistrano" | |
| require "delayed/recipes" | |
| require 'capistrano_colors' | |
| # multistage ---------------- | |
| set :stages, %w(staging production) | |
| set :default_stage, "staging" |
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
| ~/Sites/example$ cap deploy:migrations ✹master ‹ruby-1.9.2@rails31› | |
| triggering start callbacks for `deploy:migrations' | |
| * 11:44:19 == Currently executing `multistage:ensure' | |
| *** Defaulting to `staging' | |
| * 11:44:19 == Currently executing `staging' | |
| * 11:44:19 == Currently executing `deploy:migrations' | |
| * 11:44:19 == Currently executing `deploy:update_code' | |
| updating the cached checkout on all servers | |
| executing locally: "git ls-remote [email protected]:sandboxindustries/example.git master" | |
| command finished in 1119ms |