Sha256: 1273567f93d624897cc0dd58eb2c85c66eee9e76d6513cc12eb4f39c6b0dcb8d

Contents?: true

Size: 343 Bytes

Versions: 1

Compression:

Stored size: 343 Bytes

Contents

module Transit
  module Model
    
    module Comments
      extend ActiveSupport::Concern
      
      included do        
        field :comment_count, :type => Integer, :default => 0
        has_many :comments, as: :commentable
      end
      
      def has_comments?
        self.comment_count >= 1
      end
      
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
transit-0.0.2 lib/transit/model/comments.rb