Skip to content

Instantly share code, notes, and snippets.

@zeljkokalezic
zeljkokalezic / dry_model.rb
Last active July 25, 2017 13:54
DRY Rails model using enums
#Extended from https://gist.github.com/harssh-sparkway/8707634
#Take I - Naive
class Article < ActiveRecord::Base
def self.all_published
where("state = ?", "published")
end
def self.all_draft