Sha256: 4505d3c26179d692862576de60e06d4522fba310724f3c3d26154e702f0b2b50

Contents?: true

Size: 584 Bytes

Versions: 3

Compression:

Stored size: 584 Bytes

Contents

module Elabs
  class Note < ApplicationContentRecord
    self.table_name = 'notes'

    ADDITIONAL_HABTM_COUNTER_CACHES = [
      %w[projects notes]
    ].freeze

    validates :content, presence: true
    validates_with AssociatedAuthorValidator, relations: %w[project]

    belongs_to :user
    belongs_to :license
    belongs_to :language
    has_many :notes_tags
    has_many :projects_notes
    has_many :tags,     through: :notes_tags,     dependent: :destroy
    has_many :projects, through: :projects_notes, dependent: :destroy
    has_many :comments, as: 'content'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elabs-3.0.0 app/models/elabs/note.rb
elabs-2.0.0 app/models/elabs/note.rb
elabs-2.0.0.pre app/models/elabs/note.rb