forked from tobyjoe/cartilage
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Philip (flip) Kromer
committed
Dec 11, 2009
1 parent
b8aaff5
commit f1a8e55
Showing
3 changed files
with
5 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
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
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