Sha256: a4e276e988bb428609aaa29728cb7402ecb4aca6d79f5d6ce1b61ca0453a86f3

Contents?: true

Size: 612 Bytes

Versions: 2

Compression:

Stored size: 612 Bytes

Contents

module Landable
  module Traffic
    class PageView < ActiveRecord::Base
      include Landable::TableName
      self.record_timestamps = false

      belongs_to :visit

      lookup_for :mime_type,    class_name: MimeType
      lookup_for :http_method,  class_name: HTTPMethod
      lookup_for :path,         class_name: Path
      lookup_for :query_string, class_name: QueryString

      before_create :set_page_revision

      protected

      def set_page_revision
        page = Landable::Page.find_by(path: path)
        self.page_revision_id = page.try(:published_revision_id)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
landable-1.14.0 app/models/landable/traffic/page_view.rb
landable-1.13.2 app/models/landable/traffic/page_view.rb