Skip to content

Instantly share code, notes, and snippets.

View andyferra's full-sized avatar

Andy Ferra andyferra

View GitHub Profile
require "rubygems"
require "dm-core"
require "dm-validations"
require "spec"
class Contact
include DataMapper::Resource
property :id, Serial
property :email, String, :format => :email_address, :required => true
First Tribe Followup
Subject: {{ tribe.name }}
Dear {{ tribe.founder.name }},
It's been two weeks since you created your Tribe Page for {{ tribe.beneficiary_name }} at {{ tribe_url }}. The power of the Human Tribe Project is the ability to organically grow your Tribe, and the emotional and financial support system for your Beneficiary.
Are you looking for different ways to grow your Tribe and sell more Tribe Tags? Here are a couple ideas:
TribeInvitation
- invitor
- (custom) url
TribeMembership
- tribe
- user
- (custom) memberships_url
Order
Tribe.all(:conditions => {:founder_is_beneficiary => true, :beneficiary_id => nil}).each do |tribe|
tribe.update_attribute :beneficiary_id, tribe.founder_id
end
$(function(){
$('#home-promo').contentRotator({
itemSelector : '.promo-content',
onChange : updateControls
});
$('#promo-controls a').click(function(){
var href = $(this).attr('href');
if (href == '#previous') {
@andyferra
andyferra / application.js
Created January 28, 2010 19:37
Drop dead simple jquery plugin for nested rails forms
$(function(){
// Basic Example
$('#people').has_nested_forms('.person');
// Complex Example (see the plugin for more options)
$('#people').has_nested_forms('.person', {
depth : 2,
cycle_classes : false,
after_add : function(){ this.find('input[id$=name]').autocomplete('/people') }
IndividualProfile#update cannot be called on a dirty resource
RAILS_ROOT: /Users/bm5k/projects/devfu/pa-prevention-project
Application Trace | Framework Trace | Full Trace
/Library/Ruby/Gems/1.8/gems/dm-core-0.10.2/lib/dm-core/resource.rb:1042:in `assert_update_clean_only'
/Library/Ruby/Gems/1.8/gems/dm-core-0.10.2/lib/dm-core/resource.rb:323:in `update'
/Library/Ruby/Gems/1.8/gems/dm-validations-0.10.2/lib/dm-validations.rb:54:in `update'
/Library/Ruby/Gems/1.8/gems/dm-validations-0.10.2/lib/dm-validations/support/context.rb:30:in `validation_context'
/Library/Ruby/Gems/1.8/gems/dm-validations-0.10.2/lib/dm-validations.rb:54:in `update'
/Library/Ruby/Gems/1.8/gems/dm-core-0.10.2/lib/dm-core/resource.rb:281:in `__send__'
require 'rubygems'
require 'active_merchant'
ActiveMerchant::Billing::Base.mode = :test
gateway = ActiveMerchant::Billing::Base.gateway('paypal').new(
:login => "andy_1252435382_biz_api1.monospaced.com",
:password => "1252435407",
:signature => "Aqcbmvf5TyaGsjeP9ux2GftzrsIvAg.w5ErZiXfe3j16Srg11Jf2HPNP"
)
log/*.log
log/*.pid
db/*.db
db/*.sqlite3
db/schema.rb
tmp/**/*
.DS_Store
doc/api
doc/app
config/database.yml
alias fspec="spec -f specdoc -c"