Sha256: fe6261e252baf2fcdcca674b0d15342443c0d3fbb0909b77bfc2f8471e74c215

Contents?: true

Size: 496 Bytes

Versions: 4

Compression:

Stored size: 496 Bytes

Contents

class Post < ApplicationRecord
  include LiveRecord::Model::Callbacks

  belongs_to :user
  has_many :live_record_updates, as: :recordable, dependent: :destroy

  def self.live_record_whitelisted_attributes(post, current_user)
    # Add attributes to this array that you would like current_user to have access to.
    # Defaults to empty array, thereby blocking everything by default, only unless explicitly stated here so.
    [:title, :is_enabled, :user_id, :created_at, :updated_at]
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
live_record-0.2.6 spec/internal/app/models/post.rb
live_record-0.2.5 spec/internal/app/models/post.rb
live_record-0.2.4 spec/internal/app/models/post.rb
live_record-0.2.3 spec/internal/app/models/post.rb