enju_message 0.0.21 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  require 'erubis'
2
2
  class MessageRequest < ActiveRecord::Base
3
3
  attr_accessible :body
4
- attr_accessible :sender, :receiver, :message_template, :sent_at, :as => :admin
4
+ attr_accessible :sender, :receiver, :message_template, :as => :admin
5
5
  scope :not_sent, where('sent_at IS NULL AND state = ?', 'pending')
6
6
  scope :sent, where(:state => 'sent')
7
7
  scope :started, where(:state => 'started')
@@ -42,7 +42,8 @@ class MessageRequest < ActiveRecord::Base
42
42
  else
43
43
  raise 'body is empty!'
44
44
  end
45
- self.update_attributes({:sent_at => Time.zone.now})
45
+ self.sent_at = Time.zone.now
46
+ save!
46
47
  if ['reservation_expired_for_patron', 'reservation_expired_for_patron'].include?(self.message_template.status)
47
48
  self.receiver.reserves.each do |reserve|
48
49
  reserve.update_attribute(:expiration_notice_to_patron, true)
@@ -1,3 +1,3 @@
1
1
  module EnjuMessage
2
- VERSION = "0.0.21"
2
+ VERSION = "0.0.22"
3
3
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enju_message
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: