brunoaalves-ar_mailer 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -149,8 +149,9 @@ end
149
149
  # to learn how to enable ActiveRecord::Timestamp.
150
150
 
151
151
  def self.mailq(table_name)
152
+ puts("Mail queue:\n\n")
152
153
  klass = table_name.split('::').inject(Object) { |k,n| k.const_get n }
153
- emails = klass.find :all
154
+ emails = klass.find :all, :order => "priority ASC"
154
155
 
155
156
  if emails.empty? then
156
157
  puts "Mail queue is empty"
@@ -508,7 +509,7 @@ end
508
509
  # last 300 seconds.
509
510
 
510
511
  def find_emails
511
- options = { :conditions => ['last_send_attempt < ?', Time.now.to_i - 300] }
512
+ options = { :conditions => ['last_send_attempt < ?', Time.now.to_i - 300], :order => "priority ASC" }
512
513
  options[:limit] = batch_size unless batch_size.nil?
513
514
  mail = @email_class.find :all, options
514
515
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brunoaalves-ar_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel