Sha256: 8b6c64dbcee635fa45a5af574506317d0b28c4a6b0e71b09293ca5d75360b52b
Contents?: true
Size: 762 Bytes
Versions: 2
Compression:
Stored size: 762 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
acts_as_commentable_more-1.2.8 | lib/generators/commentable/templates/comment.rb |
acts_as_commentable_more-1.2.7 | lib/generators/commentable/templates/comment.rb |