stream_rails 2.6.4 → 2.6.5

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
  SHA256:
3
- metadata.gz: 377b89cf80c565ae9ffad3d5a91f4179af15e41ebcbf244e6d793fda2fa2ac64
4
- data.tar.gz: fbc695b7236b8d0b4c88a460bd36bbd711de3427364d849b028b2a880ba8944d
3
+ metadata.gz: 8632db482312bf19ed0fcbd8b31273bd650e89132538ebe1bc2bafa358836798
4
+ data.tar.gz: f6e2b65acfd12d715e828cd95cae7d8b81a1dd8b1d9dafd9af637a33a2714852
5
5
  SHA512:
6
- metadata.gz: a77c57b7b549b918709047e15283866d3f5c77d00f3911f6b160d89c29d52ae3cfcb1ae3650219bb5c85159549e8197345d34041a387eb170a0e8b496f67f390
7
- data.tar.gz: b4e11ac815abb93c49ce00e10697eef65c6bd9dd88aa663da0fed97c129bfeba2318eec5d6ac00a2e4b87367d500e1d597bb15c3966337613c6f3021f1c0b2b1
6
+ metadata.gz: ebd86a7f5b9249d2198c9c29f0afeec2d74c2710ed2e58f8ddae6062e69e975462cffe2dbe64206f87a079c83789af1adcbfb2bf1a917f393ef0c82a71ce62e8
7
+ data.tar.gz: 143c831391eb0707578e2ad8178f97ff855c309d574b6ac10dda701995487a362b1f336d2a09c78b1c792b9ee6d9fb6a8b466b941ab6a3141a6590626402fdc1
data/README.md CHANGED
@@ -423,7 +423,7 @@ For convenience we include a basic view:
423
423
  </div>
424
424
  ```
425
425
 
426
- The ```render_activity``` view helper will render the activity by picking the partial ```activity/_pin``` for a pin activity, ```aggregated/_follow``` for an aggregated activity with verb follow.
426
+ The ```render_activity``` view helper will render the activity by picking the partial ```activity/_pin``` for a pin activity, ```aggregated_activity/_follow``` for an aggregated activity with verb follow.
427
427
 
428
428
  The helper will automatically send ```activity``` to the local scope of the partial; additional parameters can be send as well as use different layouts, and prefix the name
429
429
 
@@ -40,10 +40,12 @@ module StreamRails
40
40
 
41
41
  def model_field?(field_value)
42
42
  return false unless field_value.respond_to?('split')
43
- bits = field_value.split(':')
44
- return false if bits.length < 2
43
+
44
+ model, _, id = field_value.rpartition(':')
45
+ return false unless model.present? && id.present?
46
+
45
47
  begin
46
- bits[0].classify.constantize
48
+ model.classify.constantize
47
49
  rescue NameError
48
50
  return false
49
51
  else
@@ -75,7 +77,7 @@ module StreamRails
75
77
  activities.each do |activity|
76
78
  activity.select { |k, _v| @fields.include? k.to_sym }.each do |_field, value|
77
79
  next unless model_field?(value)
78
- model, id = value.split(':')
80
+ model, _, id = value.rpartition(':')
79
81
  model_refs[model][id] = 0
80
82
  end
81
83
  end
@@ -90,7 +92,7 @@ module StreamRails
90
92
  create_activity_results(activities).each do |activity|
91
93
  activity.select { |k, _v| @fields.include? k.to_sym }.each do |field, value|
92
94
  next unless model_field?(value)
93
- model, id = value.split(':')
95
+ model, _, id = value.rpartition(':')
94
96
  activity[field] = objects[model][id] || value
95
97
  activity.track_not_enriched_field(field, value) if objects[model][id].nil?
96
98
  end
@@ -1,3 +1,3 @@
1
1
  module StreamRails
2
- VERSION = '2.6.4'.freeze
2
+ VERSION = '2.6.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stream_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.4
4
+ version: 2.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommaso Barbugli
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-08-03 00:00:00.000000000 Z
13
+ date: 2018-08-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionpack