Sha256: 62777f0e3deb5812424ed45503f3901e2ad7c1f53fa72aa49d0aac0abe469384

Contents?: true

Size: 364 Bytes

Versions: 4

Compression:

Stored size: 364 Bytes

Contents

require "active_support/concern"

module Transcript
  module Model
    extend ActiveSupport::Concern

    included do
      belongs_to :actor, polymorphic: true
      belongs_to :receiver, polymorphic: true

      validates :actor, presence: true
    end

    module ClassMethods
      def latest
        order('created_at DESC').first
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
transcript-0.3.0 lib/transcript/model.rb
transcript-0.2.1 lib/transcript/model.rb
transcript-0.2.0 lib/transcript/model.rb
transcript-0.1.0 lib/transcript/model.rb