proactive_support 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d2bd3b7486dfe68f0c7ea0991fb76ec906dc294
4
- data.tar.gz: 9b264238d465da658ee2241e41c02064b0fd6b17
3
+ metadata.gz: c74357a7a3c9c78d6ace4c2b1ef86331e0e23a61
4
+ data.tar.gz: 92150a75d70491e0d01da977eaf01821676a046c
5
5
  SHA512:
6
- metadata.gz: d93026ce0b36aa4fb5a45ac32b4f0d37a1aee296a40be96a63a1c3ab1e18ed790d029e6e2e936b399aa53c5c17bb0e7c3e251a34f14c4fb20cbe23201c074ad2
7
- data.tar.gz: 805a3dbffd73dd44027fce19520a68aeade214461a2d7bd1eca34b13e35d631d101d8efd9bb8e0006d0f02c234d3c750831bd8129b550758c80b895012a96f3a
6
+ metadata.gz: 432b143ced415cdb996a583b0fbb57e5b03a2398fd35499d55eb2a878cbd8854ee4392a87c5e5dddcc8ca649829d8ae21575ae10ceaea3e9dba0449b49c6f5ad
7
+ data.tar.gz: 10e830928634423dbc835b6e2790ec151fc6186499f339ef9c47e32b63c1af5ccecca5f2457b2fe4fe338e3521f9497322ceb8c35628b1b180d430fa8e8b94e4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- proactive_support (0.0.5)
4
+ proactive_support (0.0.6)
5
5
  activerecord (>= 3)
6
6
 
7
7
  GEM
@@ -8,10 +8,10 @@ module ProactiveSupport
8
8
  ::ProactiveSupport::Flag.find_or_initialize_by_customer_id_and_digest(customer_id, digest).tap do |f|
9
9
  f.source = source
10
10
  f.identifier = identifier
11
- f.filter = HashWithIndifferentAccess.new filter
11
+ f.filter = clean_object filter
12
12
  f.message = message
13
13
  f.level = options[:level] || ::ProactiveSupport::INFO
14
- f.debug_params = HashWithIndifferentAccess.new options[:debug_params]
14
+ f.debug_params = clean_object options[:debug_params]
15
15
  f.tags = options[:tags]
16
16
  f.is_transient = options.fetch(:transient, true) ? true : false
17
17
  f.last_triggered_at = ::Time.now
@@ -42,6 +42,14 @@ module ProactiveSupport
42
42
  def clear_matching(customer_id, conditions)
43
43
  ::ProactiveSupport::Flag.where(customer_id: customer_id, is_active: true).update_all({is_active: false}, conditions)
44
44
  end
45
+
46
+ def clean_object(data)
47
+ if RUBY_PLATFORM == 'java'
48
+ # This attempts to strip out any Java objects so we serialize with compatible MRI Ruby classes
49
+ data = ::JSON.load(::JSON.dump(data))
50
+ end
51
+ ::HashWithIndifferentAccess.new data
52
+ end
45
53
  end
46
54
  end
47
55
  end
@@ -1,3 +1,3 @@
1
1
  module ProactiveSupport
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proactive_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Frank