Skip to content

Instantly share code, notes, and snippets.

@jcoyne
Created October 20, 2015 16:14
Show Gist options
  • Save jcoyne/0d5ce25b4b22edfffcff to your computer and use it in GitHub Desktop.
Save jcoyne/0d5ce25b4b22edfffcff to your computer and use it in GitHub Desktop.
class Foo < ActiveFedora::Base
property :title, predicate: ::RDF::DC.title
validates_presence_of :title
end
irb(main):006:0> f = Foo.new
=> #<Foo id: nil, title: []>
irb(main):007:0> f.valid?
=> false
irb(main):008:0> f.errors
=> #<ActiveModel::Errors:0x007fcdbe5b99b8 @base=#<Foo id: nil, title: []>, @messages={:title=>["can't be blank"]}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment