Created
August 4, 2010 06:35
-
-
Save mikeymckay/507749 to your computer and use it in GitHub Desktop.
friendly sqlite nosql sinatra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'sinatra' | |
require 'friendly' | |
Friendly.configure({ | |
:adapter => "sqlite", | |
:database => "database.sqlite3" | |
}) | |
class Blob | |
include Friendly::Document | |
attribute :name, String | |
attribute :value, String | |
indexes :name | |
end | |
before do | |
Friendly.create_tables! | |
Blob.create({ | |
:name => "Mike", | |
:value => "Social Justice Hacker" | |
}) | |
end | |
get '/' do | |
Blob.first(:name => "Mike").inspect | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mikeymckay, I did fork of this and I have the issue #1 at the github jamesgolick/friendly. See there please.