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.
- data/app/models/message_request.rb +3 -2
- data/lib/enju_message/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- metadata +1 -1
@@ -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, :
|
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.
|
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)
|
data/lib/enju_message/version.rb
CHANGED
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|