Module: Rooftop::Coercions::AuthorCoercion

Defined in:
lib/rooftop/coercions/author_coercion.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
# File 'lib/rooftop/coercions/author_coercion.rb', line 4

def self.included(base)
  base.send(:after_find, ->(r) { r.author.registered = DateTime.parse(r.author.registered)})
  base.send(:coerce_field, {author: ->(author) { Rooftop::Author.new(author) }})
end