Sha256: eec53346cbab8368f2c95ba22ef2807ff55e7028361f7f4d4ea1e2d55e2d112f

Contents?: true

Size: 450 Bytes

Versions: 3

Compression:

Stored size: 450 Bytes

Contents

# frozen_string_literal: true

class Post < ActiveRecord::Base
  belongs_to :user

  validates :user,           presence: true
  validates :title,          presence: true
  validates :body,           presence: true
  validates :category_name,  presence: true
  validates :views_count,    numericality: true
  validates :likes_count,    numericality: true
  validates :comments_count, numericality: true

  delegate :name, to: :user, prefix: true
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
search_object-1.2.5 example/app/models/post.rb
search_object-1.2.4 example/app/models/post.rb
search_object-1.2.3 example/app/models/post.rb