You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.
Tony Wieczorek edited this page Sep 9, 2015
·
2 revisions
Dashing is build based on Sinatra, if you are already familiar with Sinatra, then I am sure this won't be a problem.
This guide aims for the people who are not so familiar with Sinatra and want a quick hint.
1. Update Gemfile, add the following lines
gem 'dm-sqlite-adapter'
gem 'data_mapper'
2. Define your data model under lib directory, lib files will be loaded before jobs directory
require "data_mapper"
DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/database.db")
class YourDataModel
include DataMapper::Resource
property :id, Serial
property :createdAt, DateTime
property :serviceName, String
property :available, Boolean, :default => true
end
# Perform basic sanity checks and initialize all relationships
# Call this when you've defined all your models
DataMapper.finalize
# automatically create the post table
YourDataModel.auto_upgrade!