ahoy_email 1.0.3 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +56 -22
- data/LICENSE.txt +1 -1
- data/README.md +181 -135
- data/app/controllers/ahoy/messages_controller.rb +27 -45
- data/app/models/ahoy/click.rb +5 -0
- data/app/models/ahoy/message.rb +1 -1
- data/config/routes.rb +3 -0
- data/lib/ahoy_email.rb +34 -9
- data/lib/ahoy_email/database_subscriber.rb +42 -0
- data/lib/ahoy_email/engine.rb +3 -1
- data/lib/ahoy_email/mailer.rb +45 -17
- data/lib/ahoy_email/message_subscriber.rb +12 -0
- data/lib/ahoy_email/processor.rb +24 -43
- data/lib/ahoy_email/redis_subscriber.rb +79 -0
- data/lib/ahoy_email/tracker.rb +9 -3
- data/lib/ahoy_email/utils.rb +35 -0
- data/lib/ahoy_email/version.rb +1 -1
- data/lib/generators/ahoy/clicks/activerecord_generator.rb +20 -0
- data/lib/generators/ahoy/clicks/mongoid_generator.rb +15 -0
- data/lib/generators/ahoy/clicks/templates/migration.rb.tt +11 -0
- data/lib/generators/ahoy/clicks/templates/mongoid.rb.tt +8 -0
- data/lib/generators/ahoy/clicks_generator.rb +37 -0
- data/lib/generators/ahoy/messages/activerecord_generator.rb +40 -0
- data/lib/generators/ahoy/messages/mongoid_generator.rb +21 -0
- data/lib/generators/{ahoy_email/templates/install.rb.tt → ahoy/messages/templates/migration.rb.tt} +2 -2
- data/lib/generators/ahoy/messages/templates/model_encrypted.rb.tt +8 -0
- data/lib/generators/ahoy/messages/templates/mongoid.rb.tt +12 -0
- data/lib/generators/ahoy/messages/templates/mongoid_encrypted.rb.tt +16 -0
- data/lib/generators/ahoy/messages_generator.rb +39 -0
- metadata +29 -113
- data/lib/generators/ahoy_email/install_generator.rb +0 -35
@@ -1,35 +0,0 @@
|
|
1
|
-
# taken from https://github.com/collectiveidea/audited/blob/master/lib/generators/audited/install_generator.rb
|
2
|
-
require "rails/generators"
|
3
|
-
require "rails/generators/migration"
|
4
|
-
require "active_record"
|
5
|
-
require "rails/generators/active_record"
|
6
|
-
|
7
|
-
module AhoyEmail
|
8
|
-
module Generators
|
9
|
-
class InstallGenerator < Rails::Generators::Base
|
10
|
-
include Rails::Generators::Migration
|
11
|
-
|
12
|
-
source_root File.expand_path("../templates", __FILE__)
|
13
|
-
|
14
|
-
# Implement the required interface for Rails::Generators::Migration.
|
15
|
-
def self.next_migration_number(dirname) #:nodoc:
|
16
|
-
next_migration_number = current_migration_number(dirname) + 1
|
17
|
-
if ActiveRecord::Base.timestamped_migrations
|
18
|
-
[Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
|
19
|
-
else
|
20
|
-
"%.3d" % next_migration_number
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def copy_migration
|
25
|
-
migration_template "install.rb", "db/migrate/create_ahoy_messages.rb", migration_version: migration_version
|
26
|
-
end
|
27
|
-
|
28
|
-
def migration_version
|
29
|
-
if ActiveRecord::VERSION::MAJOR >= 5
|
30
|
-
"[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|