Skip to content

Instantly share code, notes, and snippets.

View windock's full-sized avatar

Andrew Shcheglov windock

View GitHub Profile
@windock
windock / Product.rb
Last active September 1, 2015 21:42
# why?
# Product is simpler - works with persistence only
# names in Product directly correspond to database (product_type => type, own_videos => videos)
# less error-prone - much more difficult to call wrong method. If anyone calls product_type instead of type, he will get wrong result
# a lot less duplication
# tests will be much more simple and fast
class Product < ActiveRecord::Base
has_many :videos # not own_videos - no need to have confusing names
@windock
windock / about.md
Created August 9, 2011 16:52 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
class A
def foo
whatever
end
protected
def bar
whatever
end
end
config/environments/development.rb
MyApp::Application.configure do
# here are some existing settings
# ...
#
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
require 'spec_helper'
include ActiveMerchant::Billing
describe BillingTransaction do
describe "remote requests" do
before :each do
@response = mock("response")
@response.stub!(:success?).and_return true
@response.stub!(:authorization).and_return "some reference"
require 'spec_helper'
include ActiveMerchant::Billing
describe BillingTransaction do
describe "remote requests" do
before :each do
@response = mock("response")
@response.stub!(:success?).and_return true
@response.stub!(:authorization).and_return "some reference"