enju_message 0.1.6 → 0.1.7

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.
@@ -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, :body
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
@@ -1,3 +1,3 @@
1
1
  module EnjuMessage
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -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
 
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.1.6
4
+ version: 0.1.7
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-27 00:00:00.000000000 Z
12
+ date: 2012-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails