Sha256: f03d6231dc836745abf748ce9512bc87d6cf94a5b797c5bdfe4973f2050dd040

Contents?: true

Size: 744 Bytes

Versions: 3

Compression:

Stored size: 744 Bytes

Contents

class <%= class_name %> < ActiveRecord::Base
  ###################################################################
  ### To implement commentable add the following line to your model
  ### acts_as_commentable :<%= class_name.demodulize.downcase.pluralize %>, types: [:hide, :show], options: { class_name: '<%= class_name %>', as: :<%= class_name.demodulize.underscore %>able }, 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

3 entries across 3 versions & 1 rubygems

Version Path
acts_as_commentable_more-1.2.11 lib/generators/commentable/templates/comment.rb
acts_as_commentable_more-1.2.10 lib/generators/commentable/templates/comment.rb
acts_as_commentable_more-1.2.9 lib/generators/commentable/templates/comment.rb