Skip to content

Instantly share code, notes, and snippets.

@tylr
Created November 4, 2014 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tylr/e5679786a706450fab95 to your computer and use it in GitHub Desktop.
Save tylr/e5679786a706450fab95 to your computer and use it in GitHub Desktop.
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