File: mongoid.rb

package info (click to toggle)
ruby-ahoy-email 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 324 kB
  • sloc: ruby: 820; makefile: 6
file content (39 lines) | stat: -rw-r--r-- 861 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Mongoid.logger.level = Logger::INFO
Mongo::Logger.logger.level = Logger::INFO if defined?(Mongo::Logger)

Mongoid.configure do |config|
  config.connect_to "ahoy_email_test"
end

class User
  include Mongoid::Document

  field :email, type: String
end

class Ahoy::Message
  include Mongoid::Document

  belongs_to :user, polymorphic: true, optional: true, index: true

  field :to, type: String
  field :mailer, type: String
  field :subject, type: String
  field :sent_at, type: Time

  # opens & clicks
  field :token, type: String
  field :opened_at, type: Time
  field :clicked_at, type: Time

  # extra
  field :coupon_id, type: Integer

  # legacy
  field :content, type: String
  field :utm_source, type: String
  field :utm_campaign, type: String
  field :utm_term, type: String
  field :utm_medium, type: String
  field :utm_content, type: String
end