Skip to content

Commit

Permalink
Basic workings
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip (flip) Kromer committed Dec 11, 2009
1 parent b8aaff5 commit f1a8e55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
16 changes: 2 additions & 14 deletions app/models/subscription.rb
@@ -1,18 +1,6 @@
class Model
include DataMapper::Resource
property :id, Integer, :serial => true
property :name, Text, :nullable => false
property :created_at, DateTime
property :updated_at, DateTime
property :title, String
property :slug, String
Subscription = Struct.new(:id)

before :save,
:generate_slug_from_title

def generate_slug_from_title
self.slug = title.downcase.gsub(/[^a-z0-9]/,'-').squeeze('-').gsub(/^\-|\-$/,'')
end
Subscription.class_eval do

end

2 changes: 1 addition & 1 deletion dependencies
Expand Up @@ -2,7 +2,7 @@ dependencies 0.0.7 git://github.com/djanowski/dependencies.git
rack 1.0.0 git://github.com/rack/rack.git
rack-test (test) git://github.com/brynary/rack-test.git
sinatra 0.9.4 git://github.com/sinatra/sinatra.git
haml 2.2.3 git://github.com/nex3/haml.git
haml 2.2.15 git://github.com/nex3/haml.git
extlib 0.9.13 git://github.com/datamapper/extlib.git
oauth 0.3.6 git://github.com/mrflip/oauth.git
monk-glue 0.0.1 git://github.com/monkrb/glue.git
Expand Down
6 changes: 2 additions & 4 deletions init.rb
@@ -1,13 +1,11 @@
ROOT_DIR = File.expand_path(File.dirname(__FILE__)) unless defined? ROOT_DIR

require "rubygems"
# require "rubygems"

begin
require "vendor/dependencies/lib/dependencies"
rescue LoadError
require "dependencies"
end

require "monk/glue"
require "json"
require 'sinatra'
Expand All @@ -27,7 +25,7 @@ class Main < Monk::Glue
end

# Load all application files.
Dir[root_path("app/**/*.rb")].each do |file|
Dir[Monk::Glue.root_path("app/**/*.rb")].each do |file|
require file
end

Expand Down

0 comments on commit f1a8e55

Please sign in to comment.