Sha256: e2cc5680c6216b268bf08376b5d942a9b8f08dc0c3164e4f4376a39dc475b77f

Contents?: true

Size: 625 Bytes

Versions: 1

Compression:

Stored size: 625 Bytes

Contents

require 'parole/version'

require 'active_record'
require 'active_support'

require 'parole/commentable'
require 'parole/comment'

class ActiveRecord::Base
  def self.acts_as_commentable(options = {})
    class_attribute :commentable_options, :acts_as_commentable
    self.acts_as_commentable = true
    self.commentable_options = options.reverse_merge(roles: [])
    self.commentable_options[:roles] = commentable_options[:roles].map(&:to_s)

    include Parole::Commentable
  end

  def self.acts_as_commentable?
    !!self.acts_as_commentable
  end

  def self.acts_as_comment(*args)
    include Parole::Comment
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parole-0.1 lib/parole.rb