stream_rails 2.6.4 → 2.6.5
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 +4 -4
- data/README.md +1 -1
- data/lib/stream_rails/enrich.rb +7 -5
- data/lib/stream_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8632db482312bf19ed0fcbd8b31273bd650e89132538ebe1bc2bafa358836798
|
4
|
+
data.tar.gz: f6e2b65acfd12d715e828cd95cae7d8b81a1dd8b1d9dafd9af637a33a2714852
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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, ```
|
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
|
|
data/lib/stream_rails/enrich.rb
CHANGED
@@ -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
|
-
|
44
|
-
|
43
|
+
|
44
|
+
model, _, id = field_value.rpartition(':')
|
45
|
+
return false unless model.present? && id.present?
|
46
|
+
|
45
47
|
begin
|
46
|
-
|
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.
|
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.
|
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
|
data/lib/stream_rails/version.rb
CHANGED
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
|
+
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-
|
13
|
+
date: 2018-08-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: actionpack
|