Created
November 4, 2014 20:21
-
-
Save tylr/e5679786a706450fab95 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class BustleModel < Ohm::Model | |
include ActiveModel::Validations | |
def save | |
return false unless valid? | |
super | |
end | |
end | |
class Channel < BustleModel | |
validates_presence_of :title, :slug | |
collection :articles, :Article | |
attribute :title | |
attribute :slug | |
index :slug | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment