smailer 0.8.2 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 597184be6e340a90a5aec0c7d877ebaeae878071
4
- data.tar.gz: be0274a57ca1f64b01398ca45b2bab0ae770aba5
3
+ metadata.gz: ebecfeedfc09ce5e112ec8d1b0ef54b2cf555987
4
+ data.tar.gz: eeca779d20eb280c7bd70c404bf9d8f7fbef33b7
5
5
  SHA512:
6
- metadata.gz: 34a053d61e746507658a348e6f2f59a0d82a49b5e7ddae10648f5f9399f5a24fa7d9a3fc4c6e09db24beac000bcea155d8a9c62a70851d898377667c3711c779
7
- data.tar.gz: 9747adc90ed4c575516df92f07aae7edc7a943b882d34e50d66c6cf1e0891720a252f1eeeb0cef4736501475b350936092126c12b063a086f5120f8330f8ae06
6
+ metadata.gz: 6e0b47c7ac4523f2f5a5c9e026eb75c4b077d1960311a9e1a3bdd893fa6f9b4544e6a44280b7a9b11389eb524f91adaf5c7460fcd5300f6b0772d86e9a742812
7
+ data.tar.gz: e839bd72c3e76adb2cf2d2464c925a27f1033a1c400d8f67b1aef345d1f1723b256960a17218a46800287a09505759dceed0e2f36969e38dd214b6c4f4957825
@@ -1,3 +1,10 @@
1
+ ## Version v0.8.3
2
+
3
+ - Fixes Rails 5 compatibility by properly detecting when not to use
4
+ `attr_accessible`.
5
+
6
+ No special actions are required to upgrade from v0.8.1.
7
+
1
8
  ## Version v0.8.2
2
9
 
3
10
  - Fixes broken unsubscribe and tracking links (broken by improper unique
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smailer (0.8.1)
4
+ smailer (0.8.3)
5
5
  bounce_email (~> 0.2)
6
6
  mail (~> 2.3)
7
7
 
@@ -198,3 +198,6 @@ DEPENDENCIES
198
198
  smailer!
199
199
  spork
200
200
  sqlite3
201
+
202
+ BUNDLED WITH
203
+ 1.12.5
data/README.md CHANGED
@@ -12,7 +12,7 @@ It has been tested with Rails 3.0.x, Rails 3.1.0 and Rails 2.3.5.
12
12
 
13
13
  Note: for Rails 3.0.x, you will probably need to use Smailer 0.5.x, because of a version incompatibility with the `mail` Gem.
14
14
 
15
- It should work with Rails 4 as well, but it hasn't been tested extensively there. Testing and PRs for Rails 4 compatibility are welcome. See [this issue](https://github.com/livebg/smailer/issues/16) for more info.
15
+ It should work with Rails 4 and 5 as well, but it hasn't been tested extensively there. Testing and PRs for Rails 4 and 5 compatibility are welcome. See [this issue](https://github.com/livebg/smailer/issues/16) for more info.
16
16
 
17
17
  ## Install
18
18
 
@@ -0,0 +1 @@
1
+ ../../../lib/generators/smailer/templates/migration.rb.erb
@@ -2,6 +2,10 @@ module Smailer
2
2
  module Compatibility
3
3
  extend self
4
4
 
5
+ def rails_2?
6
+ Rails::VERSION::MAJOR == 2
7
+ end
8
+
5
9
  def rails_3?
6
10
  Rails::VERSION::MAJOR == 3
7
11
  end
@@ -14,6 +18,10 @@ module Smailer
14
18
  rails_3? || rails_4?
15
19
  end
16
20
 
21
+ def has_attr_accessible?
22
+ rails_2? || rails_3?
23
+ end
24
+
17
25
  def save_without_validation(object)
18
26
  rails_3_or_4? ? object.save(:validate => false) : object.save(false)
19
27
  end
@@ -20,7 +20,7 @@ module Smailer
20
20
  validates_numericality_of :mailing_list_id, :unsubscribe_methods, :only_integer => true, :allow_nil => true
21
21
  validates_length_of :from, :subject, :maximum => 255, :allow_nil => true
22
22
 
23
- unless Smailer::Compatibility.rails_4?
23
+ if Smailer::Compatibility.has_attr_accessible?
24
24
  attr_accessible :mailing_list_id, :from, :reply_to, :subject, :body_html, :body_text
25
25
  end
26
26
 
@@ -8,7 +8,7 @@ module Smailer
8
8
  validates_uniqueness_of :key
9
9
  validates_length_of :email, :key, :maximum => 255
10
10
 
11
- unless Smailer::Compatibility.rails_4?
11
+ if Smailer::Compatibility.has_attr_accessible?
12
12
  attr_accessible :email, :key
13
13
  end
14
14
 
@@ -7,7 +7,7 @@ module Smailer
7
7
  validates_uniqueness_of :name
8
8
  validates_length_of :name, :maximum => 255
9
9
 
10
- unless Smailer::Compatibility.rails_4?
10
+ if Smailer::Compatibility.has_attr_accessible?
11
11
  attr_accessible :name
12
12
  end
13
13
  end
@@ -10,7 +10,7 @@ module Smailer
10
10
  validates_presence_of :name
11
11
  validates_uniqueness_of :name
12
12
 
13
- unless Smailer::Compatibility.rails_4?
13
+ if Smailer::Compatibility.has_attr_accessible?
14
14
  attr_accessible :name, :value, :notes
15
15
  end
16
16
 
@@ -15,7 +15,7 @@ module Smailer
15
15
  validates_numericality_of :mail_campaign_id, :retries, :only_integer => true, :allow_nil => true
16
16
  validates_length_of :to, :last_error, :maximum => 255, :allow_nil => true
17
17
 
18
- unless Smailer::Compatibility.rails_4?
18
+ if Smailer::Compatibility.has_attr_accessible?
19
19
  attr_accessible :mail_campaign, :mail_campaign_id, :to, :from, :reply_to, :subject, :body_html, :body_text, :require_uniqueness
20
20
  end
21
21
 
@@ -1,7 +1,7 @@
1
1
  module Smailer
2
2
  MAJOR = 0
3
3
  MINOR = 8
4
- PATCH = 2
4
+ PATCH = 3
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].join('.')
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitar Dimitrov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-11 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  version: 1.3.6
160
160
  requirements: []
161
161
  rubyforge_project: smailer
162
- rubygems_version: 2.2.2
162
+ rubygems_version: 2.6.4
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: A simple newsletter mailer for Rails.
@@ -1,117 +0,0 @@
1
- class CreateSmailerTables < ActiveRecord::Migration
2
- def self.up
3
- create_table "finished_mails", :force => :cascade do |t|
4
- t.integer "mail_campaign_id"
5
- t.string "from"
6
- t.string "to"
7
- t.string "subject"
8
- t.text "body_html"
9
- t.integer "retries"
10
- t.datetime "last_retry_at"
11
- t.string "last_error"
12
- t.datetime "sent_at"
13
- t.integer "status"
14
- t.datetime "created_at"
15
- t.datetime "updated_at"
16
- t.text "body_text"
17
- t.boolean "opened", :default => false, :null => false
18
- t.string "key"
19
- end
20
-
21
- add_index "finished_mails", ["key"], :name => "index_finished_mails_on_key", :unique => true
22
- add_index "finished_mails", ["mail_campaign_id", "status"], :name => "index_finished_mails_on_mail_campain_id_and_status"
23
- add_index "finished_mails", ["to", "mail_campaign_id"], :name => "index_finished_mails_on_to_and_mail_campaign_id"
24
-
25
- create_table "mail_attachments", :force => :cascade do |t|
26
- t.string "filename", :null => false
27
- t.string "path", :limit => 2048
28
- t.datetime "created_at"
29
- t.datetime "updated_at"
30
- t.integer "mail_template_id"
31
- end
32
-
33
- add_index "mail_attachments", ["mail_template_id"], :name => "index_mail_attachments_on_mail_template_id"
34
-
35
- create_table "mail_campaigns", :force => :cascade do |t|
36
- t.integer "mailing_list_id"
37
- t.integer "unsubscribe_methods"
38
- t.datetime "created_at"
39
- t.datetime "updated_at"
40
- t.integer "sent_mails_count", :default => 0, :null => false
41
- t.integer "opened_mails_count", :default => 0, :null => false
42
- end
43
-
44
- add_index "mail_campaigns", ["mailing_list_id"], :name => "index_mail_campaigns_on_mailing_list_id"
45
-
46
- create_table "mail_keys", :force => :cascade do |t|
47
- t.string "email"
48
- t.string "key"
49
- t.datetime "created_at"
50
- t.datetime "updated_at"
51
- end
52
-
53
- add_index "mail_keys", ["email"], :name => "index_mail_keys_on_email", :unique => true
54
- add_index "mail_keys", ["key"], :name => "index_mail_keys_on_key", :unique => true
55
-
56
- create_table "mail_templates", :force => :cascade do |t|
57
- t.integer "mail_campaign_id"
58
- t.integer "queued_mail_id"
59
- t.string "from"
60
- t.string "subject"
61
- t.text "body_html"
62
- t.text "body_text"
63
- t.datetime "created_at"
64
- t.datetime "updated_at"
65
- t.string "reply_to"
66
- end
67
-
68
- add_index "mail_templates", ["mail_campaign_id"], :name => "index_mail_templates_on_mail_campaign_id"
69
- add_index "mail_templates", ["queued_mail_id"], :name => "index_mail_templates_on_queued_mail_id"
70
-
71
- create_table "mailing_lists", :force => :cascade do |t|
72
- t.string "name"
73
- t.datetime "created_at"
74
- t.datetime "updated_at"
75
- end
76
-
77
- create_table "queued_mails", :force => :cascade do |t|
78
- t.integer "mail_campaign_id"
79
- t.string "to"
80
- t.integer "retries", :default => 0, :null => false
81
- t.datetime "last_retry_at"
82
- t.string "last_error"
83
- t.boolean "locked", :default => false, :null => false
84
- t.datetime "locked_at"
85
- t.datetime "created_at"
86
- t.datetime "updated_at"
87
- t.string "key"
88
- t.boolean "require_uniqueness", :default => true
89
- end
90
-
91
- add_index "queued_mails", ["locked", "locked_at"], :name => "index_queued_mails_on_locked_and_locked_at"
92
- add_index "queued_mails", ["locked", "retries", "id"], :name => "index_queued_mails_on_locked_retries_and_id"
93
- add_index "queued_mails", ["mail_campaign_id", "to", "require_uniqueness"], :name => "index_queued_mails_uniqueness_for_to", :unique => true
94
- add_index "queued_mails", ["retries", "locked"], :name => "index_queued_mails_on_retries_and_locked"
95
-
96
- create_table "smailer_properties", :force => :cascade do |t|
97
- t.string "name"
98
- t.text "value"
99
- t.datetime "created_at"
100
- t.datetime "updated_at"
101
- t.string "notes"
102
- end
103
-
104
- add_index "smailer_properties", ["name"], :name => "index_smailer_properties_on_name", :unique => true
105
- end
106
-
107
- def self.down
108
- drop_table :smailer_properties
109
- drop_table :mail_keys
110
- drop_table :finished_mails
111
- drop_table :queued_mails
112
- drop_table :mail_attachments
113
- drop_table :mail_campaigns
114
- drop_table :mail_templates
115
- drop_table :mailing_lists
116
- end
117
- end