Sha256: 905ecd0cb97af5c12feb7d08a0dc32492d8c92fbd110ba23b121d082a2a21c7c

Contents?: true

Size: 598 Bytes

Versions: 6

Compression:

Stored size: 598 Bytes

Contents

module Knitkit
  module Extensions
    module ActiveRecord
      module ActsAsCommentable
        def self.included(base)
          base.extend(ClassMethods)
        end

        module ClassMethods

          def acts_as_commentable
            has_many :comments, :as => :commented_record, :dependent => :destroy

            extend ActsAsCommentable::SingletonMethods
            include ActsAsCommentable::InstanceMethods
          end

        end

        module SingletonMethods
        end

        module InstanceMethods
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
knitkit-2.0.5 lib/knitkit/extensions/active_record/acts_as_commentable.rb
knitkit-2.0.4 lib/knitkit/extensions/active_record/acts_as_commentable.rb
knitkit-2.0.3 lib/knitkit/extensions/active_record/acts_as_commentable.rb
knitkit-2.0.2 lib/knitkit/extensions/active_record/acts_as_commentable.rb
knitkit-2.0.1 lib/knitkit/extensions/active_record/acts_as_commentable.rb
knitkit-2.0.0 lib/knitkit/extensions/active_record/acts_as_commentable.rb