ramen-rails 0.6.3 → 0.6.4
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/CHANGELOG +4 -0
- data/lib/ramen-rails/ramen_after_filter.rb +2 -2
- data/lib/ramen-rails/version.rb +1 -1
- data/spec/lib/ramen_after_filter_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4b6bf2f436424841a968e23d07e9f55a873cb40
|
4
|
+
data.tar.gz: 496743ad914cfc6b572e5c5d1e02c49c67f988b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c79e791ce639e5704f6311495d962b008e486d2efc43d4e882315b93acfdfe824c27554d7c9c9eea339842a46e641a0587fe7a9fa07cc6af8fb0dde7fdc7929
|
7
|
+
data.tar.gz: 5faf2cd7d1f02093d11729d8445780218cbd714024112dae4063890713e3715d0e81c7fbc4523dd6e8ddbe2e3e6809a7ae8cc25e0498f92097b81b19d78f78ad
|
data/CHANGELOG
CHANGED
@@ -34,3 +34,7 @@ Version 0.6.3
|
|
34
34
|
Since we fallback on `current_company` if it is not provided, we shouldn't throw an exception if that
|
35
35
|
object doesn't conform to the interface we're expecting. Try to get name, url, and id, but don't force
|
36
36
|
it.
|
37
|
+
|
38
|
+
Version 0.6.4
|
39
|
+
Run #to_s on name, email, id (Customer) and url, name, id (Company) to deal with (among other things)
|
40
|
+
how MongoDB BSON::ObjectIds are serialized
|
@@ -206,7 +206,7 @@ module RamenRails
|
|
206
206
|
raise InvalidUserObject.new("User #{user} does not respond to and have a present? #email") unless user.respond_to?(:email) && user.email.present?
|
207
207
|
|
208
208
|
[:email, :name, :id].each do |attr|
|
209
|
-
obj[:user][attr] = user.send(attr)
|
209
|
+
obj[:user][attr] = user.send(attr).to_s
|
210
210
|
end
|
211
211
|
|
212
212
|
if user.respond_to?(:created_at) && user.send(:created_at).present?
|
@@ -226,7 +226,7 @@ module RamenRails
|
|
226
226
|
obj[:company] = {}
|
227
227
|
|
228
228
|
[:url, :name, :id].each do |attr|
|
229
|
-
obj[:company][attr] = company.send(attr) if company.respond_to?(attr)
|
229
|
+
obj[:company][attr] = company.send(attr).to_s if company.respond_to?(attr)
|
230
230
|
end
|
231
231
|
|
232
232
|
if company.respond_to?(:traits) && company.send(:traits).present?
|
data/lib/ramen-rails/version.rb
CHANGED
@@ -102,6 +102,17 @@ describe 'After filter' do
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
+
context "with an object id" do
|
106
|
+
before :each do
|
107
|
+
@dummy.current_user = Dummy::User.with(email: 'ryan@ramen.is', name: 'Ryan Angilly', id: {'$oid' => 'person-1234'})
|
108
|
+
end
|
109
|
+
|
110
|
+
it "should to_s the ID" do
|
111
|
+
filter = RamenRails::RamenAfterFilter.filter(@dummy)
|
112
|
+
expect(@dummy.response.body).to include(%q|id":"{\"$oid\"|)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
105
116
|
context "with a value proc set" do
|
106
117
|
before :each do |c|
|
107
118
|
@dummy.current_user.set value: 1000
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ramen-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Angilly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|