Sha256: 07459fd9d3c534cccf7e7099988a3506e71a2fe32071095bdf2f9dde36a8dbdf

Contents?: true

Size: 260 Bytes

Versions: 3

Compression:

Stored size: 260 Bytes

Contents

class Post < ApplicationRecord
  belongs_to :author, class_name: 'User', foreign_key: :user_id
  belongs_to :category

  # tutorial: https://youtu.be/WgNK-oINFww?t=209
  def excerpt
    ActionView::Base.full_sanitizer.sanitize(content).truncate(100)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_app_generator-0.2.38 after_templates/addons/avo/app/models/post.rb
rails_app_generator-0.2.37 after_templates/addons/avo/app/models/post.rb
rails_app_generator-0.2.36 after_templates/addons/avo/app/models/post.rb