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
# encoding: utf-8 | |
require 'heroku-api' | |
namespace :heroku do | |
desc "Scale down the processes during business hours" | |
task :spin_down => :environment do | |
app = ENV['HEROKU_APP'] | |
heroku = Heroku::API.new(:api_key => ENV['HEROKU_API_KEY']) |
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
# encoding: utf-8 | |
class Article | |
attr_accessor :title, :body | |
def initalize(title, body) | |
self.title = title | |
self.body = body | |
end | |
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
# encoding: utf-8 | |
class Context | |
class Context::Result | |
def initialize(*args, &block) | |
args.extract_options!.each do |attr, value| | |
send("#{attr}=", numeric?(value)) if respond_to?("#{attr}=") | |
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
# encoding: utf-8 | |
class Context | |
def sanitize_sql(array) | |
self.class.sanitize_sql(array) | |
end | |
def select_all(sql) | |
self.class.select_all(sql) |
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
# encoding: utf-8 | |
class AlbumForm < BaseForm | |
has_many :songs, class_name: 'SongForm' | |
validates :songs, form_collection: true | |
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
# encoding: utf-8 | |
gem 'sqlite3', '1.3.6' | |
gem 'activerecord', '3.2.8' | |
require 'active_record' | |
require 'logger' | |
puts "Active Record #{ActiveRecord::VERSION::STRING}" |
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
# encoding: utf-8 | |
gem 'sqlite3', '1.3.6' | |
gem 'activerecord', '3.2.8' | |
gem 'squeel', '1.0.11' | |
require 'active_record' | |
require 'squeel' | |
require 'squeel/version' |
NewerOlder