culturecode_stagehand 0.13.3 → 0.13.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ed3d3abf2a64c62d90182193fe80714d2bd8418
4
- data.tar.gz: 4825e8a8e5621fc84020f57269589a4cea1ee04b
3
+ metadata.gz: 36834ff03b03124d75cbdcf9705e22e9ad76b12a
4
+ data.tar.gz: e12e718f0adaf192a16ccfb51e9f4d36ffd54f52
5
5
  SHA512:
6
- metadata.gz: 5d4b00fbdf65ce78f0d930732b0cb1477e0fcb7d94c5f58008483c613fa7a72a14390e480b9d48912c45a3d43ba9f4f21707d11cc235b810ca3731fddf0c403e
7
- data.tar.gz: edb00a7aa78d1c5f16f8eab425447790b53de432568531453908f7ce38c218abc617d47324b77239f043dc485327c32df730cf049305dde641b7b7bee4f82655
6
+ metadata.gz: 3781b0fb8eb9f013d15a2de73fb5a2a1b3b4dda9c42b09744688a87fd7504f176af38c46cbc6077bbc7cc2e1b92f7b0278191294557bb943817327e00bc4f4f4
7
+ data.tar.gz: e9305cfcbd35587d1fcf70f9e4d54f55ccd14a52aa4adc5bfd4eb26d7c5d64471a5a45ea0f64a3742e6d295e4e501b153196db4f1aced4ae9694f549b447f46a
@@ -43,7 +43,8 @@ module Stagehand
43
43
 
44
44
  # Make it easy to set the subject for the duration of the commit block
45
45
  def start_operation.subject=(record)
46
- update_attributes!(:record_id => record.try(:id), :table_name => record.class.try(:table_name))
46
+ self.assign_attributes :record_id => record.id, :table_name => record.class.table_name if record && record.id
47
+ save!
47
48
  end
48
49
 
49
50
  start_operation.subject = subject_record
@@ -70,6 +70,9 @@ module Stagehand
70
70
  raise(IndeterminateRecordClass, "Can't determine class from table name: #{table_name}")
71
71
  end
72
72
 
73
+ validates_presence_of :record_id, :if => :table_name
74
+ validates_presence_of :table_name, :if => :record_id
75
+
73
76
  def record
74
77
  @record ||= delete_operation? ? build_deleted_record : record_class.find_by_id(record_id) if record_id?
75
78
  end
@@ -1,3 +1,3 @@
1
1
  module Stagehand
2
- VERSION = "0.13.3"
2
+ VERSION = "0.13.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: culturecode_stagehand
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.13.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Jakobsen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-08 00:00:00.000000000 Z
12
+ date: 2017-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.5.2
127
+ rubygems_version: 2.6.12
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Simplify the management of a sandbox database that can sync content to a