enju_message 0.0.22 → 0.0.23
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, :as => :admin
|
4
|
+
attr_accessible :sender, :receiver, :message_template, :body, :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')
|
@@ -11,7 +11,8 @@ class MessageRequest < ActiveRecord::Base
|
|
11
11
|
has_many :messages
|
12
12
|
|
13
13
|
validates_associated :sender, :receiver, :message_template
|
14
|
-
validates_presence_of :sender, :receiver, :message_template
|
14
|
+
validates_presence_of :sender, :receiver, :message_template
|
15
|
+
validates_presence_of :body, :on => :update
|
15
16
|
|
16
17
|
state_machine :initial => :pending do
|
17
18
|
before_transition any - :sent => :sent, :do => :send_message
|
data/lib/enju_message/version.rb
CHANGED
@@ -124,7 +124,7 @@ describe MessageRequestsController do
|
|
124
124
|
describe "PUT update" do
|
125
125
|
before(:each) do
|
126
126
|
@message_request = FactoryGirl.create(:message_request)
|
127
|
-
@attrs = FactoryGirl.attributes_for(:message_request)
|
127
|
+
@attrs = FactoryGirl.attributes_for(:message_request).merge(:body => 'test')
|
128
128
|
@invalid_attrs = {:body => ''}
|
129
129
|
end
|
130
130
|
|
data/spec/dummy/db/test.sqlite3
CHANGED
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.
|
4
|
+
version: 0.0.23
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|