Skip to content
View gist:1186738
class Client < ActiveRecord::Base
has_many :client_companies, :dependent => :destroy
has_many :contracts , :dependent => :destroy
accepts_nested_attributes_for :client_companies , :allow_destroy => true
end
class ClientCompany < ActiveRecord::Base
belongs_to :client
module Shoulda # :nodoc:
module ActiveRecord # :nodoc:
# Examples:
# class Book < ActiveRecord::Base
# named_scope :test, :conditions => { :name => "test" }
# named_scope :by_name, lambda { |n| { :conditions => { :name => n} } }
# end
#
# RSpec:
RSpec::Matchers.define :allow do |*values|
match do |record|
values.collect {|value|
record.send("#{@attribute}=", value)
record.valid?
record.errors[@attribute].empty?
}.all?
end
chain :as do |attribute|
View gist:797446
# bash_completion - programmable completion functions for bash 3.x
# (backwards compatible with bash 2.05b)
#
# $Id: bash_completion,v 1.872 2006/03/01 16:20:18 ianmacd Exp $
#
# Copyright (C) Ian Macdonald <ian@caliban.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
View gist:661410
$ cucumber --backtrace --verbose --tags @bank_account
Using the default profile...
Code:
* features/support/env.rb
* features/support/paths.rb
* features/step_definitions/base_steps.rb
* features/step_definitions/web_steps.rb
* features/step_definitions/web_steps_pt-br.rb
Features:
View gist:661407
$ cucumber --backtrace --verbose --tags @bank_accountUsing the default profile...
Code:
* features/support/env.rb
* features/support/paths.rb
* features/step_definitions/base_steps.rb
* features/step_definitions/web_steps.rb
* features/step_definitions/web_steps_pt-br.rb
Features:
* features/admin/admin_bank_accounts.feature
View gist:535853
source 'http://rubygems.org'
gem 'rails', '3.0.0.rc'
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# ----------------------------------------------------------------------- #
# Default
gem 'inherited_resources', '1.1.2'
gem 'will_paginate', "~> 3.0.pre2"
View gist:531743
class RoleSets
role :admin do
can :manage, :all
end
role :diretoria do
can [:read, :edit], [Post]
end
role :maluco do
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'shoulda'
require 'webrat'
require 'factory_girl'
require 'test/factories/clearance'
require 'clearance/../../shoulda_macros/clearance'
require 'cucumber/rails/world'
Cucumber::Rails.use_transactional_fixtures
View gist:397579
# Sean Porter (http://portertech.ca)
# Example unicorn configuration for a decent VPS (Virtual Private Server)
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete documentation.
# Use at least one worker per core
worker_processes 6
# Help ensure your application will always spawn in the symlinked "current" directory that Capistrano sets up
working_directory "/var/www/myapp"
Something went wrong with that request. Please try again.