Skip to content

Instantly share code, notes, and snippets.

@febuiles
Created November 28, 2008 04:00
Show Gist options
  • Select an option

  • Save febuiles/29901 to your computer and use it in GitHub Desktop.

Select an option

Save febuiles/29901 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'dm-core'
DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/frankie.sqlite3")
class Recipient
include DataMapper::Resource
property :id, Integer, :serial => true
property :name, Text
property :email, Text, :nullable => false, :unique => true
def self.get_emails
all.collect { |recipient| recipient.email }
end
end
Recipient.get_emails
# => ArgumentError - Unknown property 'get_emails'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment