Skip to content

Instantly share code, notes, and snippets.

@mikeymckay
Created August 4, 2010 06:35
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mikeymckay/507749 to your computer and use it in GitHub Desktop.
Save mikeymckay/507749 to your computer and use it in GitHub Desktop.
friendly sqlite nosql sinatra
#!/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
@alexandre-mbm
Copy link

@mikeymckay, I did fork of this and I have the issue #1 at the github jamesgolick/friendly. See there please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment