Sha256: 560bd76b919a570716bf22ee2c407be3e0aac0ada3098a5c39e8f220547d7b62
Contents?: true
Size: 667 Bytes
Versions: 31
Compression:
Stored size: 667 Bytes
Contents
module PostForm class Base include ObjectAttorney represents :post delegate_properties :title, :body, to: :post has_many :comments validates_presence_of :title end class Explicit include ObjectAttorney represents :post has_many :comments validates_presence_of :title def body=(value) post.body = value end def body post.body end def title=(value) post.title = value end def title post.title end def build_comment(attributes = {}) post.comments.build(attributes) end def existing_comments post.comments end end end
Version data entries
31 entries across 31 versions & 1 rubygems