naranya_ecm-sdk 0.0.57 → 0.0.58

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: b55e37ef5c34422a09b630352c05cdaf374003b2
4
- data.tar.gz: 125d9f224dc529934e3f462360a5206136a2a685
3
+ metadata.gz: dcb9f2aa5a4616f644664fd5f8ae14c09be7c29e
4
+ data.tar.gz: ce27bb81cf8cf06b8ca0196b7681f518bd525412
5
5
  SHA512:
6
- metadata.gz: 9b989ed80cc100968d53f9a28448e931b4d772eb1ff5564a841a0a1b1ffb0f23491698b3e3b66ac631e262cc3180976719d62f154464b70c1da9d7a9354cd3f3
7
- data.tar.gz: 9f44623ef0b24661a16196531c40553fdd692ebbb9b95e4ff44b2ef997ded2fe90b8904ce2f0425e2d172855fbf07a2d0906abeb8106794f71bc32fe0e08e37c
6
+ metadata.gz: 3f38aa840f75c6d4af6cf50011c355a963c4fbbb100e32694de7c465f78b92da1f966aeac3c319cdc691f67a6bc1612d489d65e72458b5de366b740a38311778
7
+ data.tar.gz: 811474c9ca72bb5a88cf954c253c823373b770b3da5417a6c73dee7010d1632a054dfb09895a38f3e5007f85b40453b49a01b3a134624a8f7515b4559ef1a0a7
@@ -62,7 +62,7 @@ module AASM
62
62
 
63
63
  # protected
64
64
  # def with_state_scope(state)
65
- # with_scope :find => {:conditions => ["#{table_name}.#{aasm_column} = ?", state.to_s]} do
65
+ # with_scope :find => {:conditions => ["#{table_name}.#{aasm.attribute_name} = ?", state.to_s]} do
66
66
  # yield if block_given?
67
67
  # end
68
68
  # end
@@ -80,11 +80,11 @@ module AASM
80
80
  # #
81
81
  # # NOTE: intended to be called from an event
82
82
  # def aasm_write_state(state)
83
- # old_value = self.send self.class.aasm_column.to_sym
84
- # write_attribute(self.class.aasm_column, state.to_s)
83
+ # old_value = self.send self.class.aasm.attribute_name.to_sym
84
+ # write_attribute(self.class.aasm.attribute_name, state.to_s)
85
85
 
86
86
  # unless self.save(:validate => false)
87
- # write_attribute(self.class.aasm_column, old_value)
87
+ # write_attribute(self.class.aasm.attribute_name, old_value)
88
88
  # return false
89
89
  # end
90
90
 
@@ -104,23 +104,28 @@ module AASM
104
104
  # #
105
105
  # # NOTE: intended to be called from an event
106
106
  # def aasm_write_state_without_persistence(state)
107
- # self.off_band_changes["#{self.class.aasm_column}_event"] = transition.event
107
+ # self.off_band_changes["#{self.class.aasm.attribute_name}_event"] = transition.event
108
108
  # end
109
109
 
110
110
  private
111
111
 
112
112
  def aasm_ensure_initial_state
113
- send("#{self.class.aasm_column}=", aasm.enter_initial_state.to_s) if send(self.class.aasm_column).blank?
113
+ send("#{self.class.aasm.attribute_name}=", aasm.enter_initial_state.to_s) \
114
+ if send(self.class.aasm.attribute_name).blank?
114
115
  end
115
116
 
116
117
  def aasm_fire_event(name, options, *args, &block)
117
118
  local_success = super
118
119
  remote_success = if local_success
119
- data = { name: name, target_type: self.class.name.demodulize, target_id: self.id }
120
+ data = {
121
+ name: name,
122
+ target_type: self.class.name.demodulize,
123
+ target_id: self.id
124
+ }
120
125
 
121
- # byebug
122
126
  unless NContent::SDK.config.state_event_delay < 1
123
- NContent::SDK.logger.debug "Will wait #{NContent::SDK.config.state_event_delay} seconds before posting the event..."
127
+ msg = "Will wait #{NContent::SDK.config.state_event_delay} seconds"
128
+ NContent::SDK.logger.debug "#{msg} before posting the event..."
124
129
  sleep NContent::SDK.config.state_event_delay
125
130
  end
126
131
 
@@ -129,13 +134,14 @@ module AASM
129
134
  req.body = ActiveSupport::JSON.encode(state_event: data)
130
135
  end
131
136
 
132
- state_attribute = self.class.aasm_column
137
+ state_attribute = self.class.aasm.attribute_name
133
138
  state_before_reload = self.send(state_attribute)
134
139
 
135
140
  reload
136
141
  state_after_reload = self.send(state_attribute)
137
142
 
138
- NContent::SDK.logger.debug "Event: #{name} - #{state_attribute} #{state_before_reload} -> #{state_after_reload}"
143
+ msg = "Event: #{name} - #{state_attribute} #{state_before_reload}"
144
+ NContent::SDK.logger.debug "#{msg} -> #{state_after_reload}"
139
145
 
140
146
  # Check that the state changed (and return the result of that check)
141
147
  state_before_reload != state_after_reload
@@ -1,3 +1,3 @@
1
1
  module NaranyaEcm
2
- VERSION = "0.0.57"
2
+ VERSION = "0.0.58"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: naranya_ecm-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.57
4
+ version: 0.0.58
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Quintanilla
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-05-25 00:00:00.000000000 Z
11
+ date: 2015-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport