smailer 0.7.2 → 0.7.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: 5a802147c81ef44bbccab4c0dd6319aadb8ba8ad
4
- data.tar.gz: 51d003004e3bf9296ec29d656b9119dfaf62c044
3
+ metadata.gz: 882d4145d4e47583284e40abbea61a4904131776
4
+ data.tar.gz: b411a56313daeaaf2fcf7d6dd48727ab692747ee
5
5
  SHA512:
6
- metadata.gz: 5518b27f7990285c16ec5571da8263b9600eddea60f4c386dca742a1c62aa0833fdb58898220141016e8604b6034e1588f4e6105c86fc7fa658982c6604b16a3
7
- data.tar.gz: 45c66ce79bdee5eb44d626990d99c1d1679916248a295205dbe38788d5b21c1d7b61188e8c931c8963cc2569ddb0bc680e40e61e48c54a92a5b9d6223e019ed0
6
+ metadata.gz: 91baf3610b97979df6157b8420ef4e60288d2d786b878d0f2677342dda4f8deb54864be4186b0ca14eef5287233c9435536d04e01af3598a2751b0fdac7b4734
7
+ data.tar.gz: 5527e195641bfdde27c9e5843905fa35d0760f55fe6ae3b7a56c2968b4f7af8c37dcced95a8083e2bb0722f2ea341ac6aad23806e896ea6dbb75c067433c7683
@@ -10,12 +10,16 @@ module Smailer
10
10
  belongs_to :mailing_list
11
11
  has_many :queued_mails, :dependent => :destroy
12
12
  has_many :finished_mails, :dependent => :destroy
13
+ has_many :attachments,
14
+ :class_name => '::Smailer::Models::MailCampaignAttachment'
13
15
 
14
16
  validates_presence_of :mailing_list_id, :from
15
17
  validates_numericality_of :mailing_list_id, :unsubscribe_methods, :only_integer => true, :allow_nil => true
16
18
  validates_length_of :from, :subject, :maximum => 255, :allow_nil => true
17
19
 
18
- attr_accessible :mailing_list_id, :from, :subject, :body_html, :body_text
20
+ unless Smailer::Compatibility.rails_4?
21
+ attr_accessible :mailing_list_id, :from, :subject, :body_html, :body_text
22
+ end
19
23
 
20
24
  def add_unsubscribe_method(method_specification)
21
25
  unsubscribe_methods_list_from(method_specification).each do |method|
@@ -50,6 +54,10 @@ module Smailer
50
54
  opened_mails_count.to_f / sent_mails_count
51
55
  end
52
56
 
57
+ def add_attachment(filename, path)
58
+ self.attachments.create!(:filename => filename, :path => path)
59
+ end
60
+
53
61
  def self.unsubscribe_methods
54
62
  methods = {}
55
63
  UnsubscribeMethods.constants.map do |method_name|
@@ -1,7 +1,7 @@
1
1
  module Smailer
2
2
  MAJOR = 0
3
3
  MINOR = 7
4
- PATCH = 2
4
+ PATCH = 3
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].join('.')
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitar Dimitrov