Archive for the 'datamapper' Category
October 13th, 2010
Source code: git repository at github
DataMapper has a defined method named first_or_create, very explicit name, that takes a condition and attributes as params. Its source code defined in dm-core-1.0.2/lib/dm-core/model.rb is:
def first_or_create(conditions = {}, attributes = {})
first(conditions) || create(conditions.merge(attributes))
end
What is does is simply find the first resource by conditions, or create a new resource with the […]
posted by pedro mg at 6:38 pm
& filed under ruby, code, merb, datamapper | No Comments »
March 10th, 2010
Apple OSX Snow Leopard
System Version: Mac OS X 10.6.2
Kernel Version: Darwin 10.2.0
Install notes for PosgreSQL 8.4 install using the great
Homebrew by Adam Vandenberg.
Run the author’s installation script, and that’s it. Try:
$ brew help
$ brew search postgresql
$ brew install postgresql
==> Summary
/usr/local/Cellar/postgresql/8.4.2: 2297 files, 31M, built in 3.3 minutes
$ brew info postgresql
postgresql 8.4.2
My advice ? Use Homebrew. True UNIX […]
posted by pedro mg at 11:15 am
& filed under tech, apple, ruby, code, git, github, gist, osx, unix, postgres, postgresql, datamapper, database, dbms | 7 Comments »
March 3rd, 2010
Install notes for Datamapper do_postgres driver ruby gem on severall operating systems:
Apple OSX Snow Leopard
System Version: Mac OS X 10.6.2
Kernel Version: Darwin 10.2.0
(No Macports; No Homebrew)
PosgreSQL 8.4
I wanted to have PosgreSQL server working on the mac so that development is easier.
There is a .dmg package from the guys at EnterpriseDB that is a single click install. Check […]
posted by pedro mg at 5:24 am
& filed under linux, os, ubuntu, apple, ruby, code, debian, vimblog.vim, vimblog, merb, osx, postgres, postgresql, datamapper | 3 Comments »