Skip to content

Instantly share code, notes, and snippets.

@bricker
Created September 13, 2012 21:50
Show Gist options
  • Save bricker/3717952 to your computer and use it in GitHub Desktop.
Save bricker/3717952 to your computer and use it in GitHub Desktop.
module Validations
module ContentValidations
extend ActiveSupport::Concern
included do
validates :slug,
presence: true,
uniqueness: { scope: :published_at, message: "was already used for the published_at date."},
format: { with: %r{[\w-]+}}
#
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment