nay-record_with_operator 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ DESCRIPTION = "Rails plugin to set created_by, updated_by, deleted_by to ActiveR
12
12
  GITHUB_PROJECT = "record_with_operator"
13
13
  HOMEPAGE = "http://github.com/nay/#{GITHUB_PROJECT}/tree"
14
14
  BIN_FILES = %w( )
15
- VER = "0.0.6"
15
+ VER = "0.0.7"
16
16
  CLEAN.include ['pkg']
17
17
 
18
18
  desc 'Default: run unit tests.'
@@ -109,7 +109,7 @@ module RecordWithOperator
109
109
 
110
110
  private
111
111
  def set_operator(child)
112
- child.operator = self.operator
112
+ child.operator ||= self.operator
113
113
  end
114
114
 
115
115
  def method_missing(method, *args)
@@ -167,6 +167,13 @@ class RecordWithOperatorTest < ActiveSupport::TestCase
167
167
  assert_equal @user2, memo.operator
168
168
  end
169
169
 
170
+ def test_builded_memo_should_have_own_set_operator
171
+ note = NoteWithUser.find(@note_created_by_user1.id)
172
+ memo = note.memos.build(:body => "memo", :operator => @user2)
173
+ assert_equal @user2, memo.operator
174
+ end
175
+
176
+
170
177
  def test_created_memo_should_have_operator_and_created_by
171
178
  note = NoteWithUser.find(@note_created_by_user1.id, :for => @user2)
172
179
  memo = note.memos.create(:body => "memo")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nay-record_with_operator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasuko Ohba