Sha256: 6c352987472e19626731efcf8bbe7fc92fadf5aa4a0062061854c6e0c99c2f60

Contents?: true

Size: 317 Bytes

Versions: 6

Compression:

Stored size: 317 Bytes

Contents

module Storytime
  class Comment < ActiveRecord::Base
    belongs_to Storytime.user_class_symbol
    belongs_to :post

    validates Storytime.user_class_symbol, presence: true
    validates :post_id, presence: true

    def commenter_name
      user.nil? ? "" : (user.storytime_name || user.email)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
storytime-1.0.5 app/models/storytime/comment.rb
storytime-1.0.2 app/models/storytime/comment.rb
storytime-1.0.1 app/models/storytime/comment.rb
storytime-1.0.0 app/models/storytime/comment.rb
storytime-0.0.4 app/models/storytime/comment.rb
storytime-0.0.2 app/models/storytime/comment.rb