Sha256: 413203031fdc00c547bb82cb2b5c268e1734220737abb7ba3585e4d8a599b60a
Contents?: true
Size: 761 Bytes
Versions: 1
Compression:
Stored size: 761 Bytes
Contents
class <%= class_name %> < ActiveRecord::Base ################################################################### ### To implement commentable add the following line to your model ### acts_as_commentable types: [:hide, :show], options: { class_name: '<%= class_name %>', as: :<%= class_name.demodulize.underscore + "able" %> }, as: :<%= class_name.demodulize.downcase.pluralize, counter_cache: true %> ### types is an array of possible comment type ### for example if you have public and private comment ### your types would be [:public, :private] belongs_to :<%= class_name.demodulize.underscore + "able" %>, :polymorphic => true belongs_to :user, polymorphic: true ################################################################### end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
acts_as_commentable_more-1.2.6 | lib/generators/commentable/templates/comment.rb |