ramen-rails 0.6.3 → 0.6.4

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: 436444c10b31bc4d33f2a4ae5a36b42a5b9954ac
4
- data.tar.gz: f975754fc33d4f7f350fef88f158ea89b2e829b2
3
+ metadata.gz: b4b6bf2f436424841a968e23d07e9f55a873cb40
4
+ data.tar.gz: 496743ad914cfc6b572e5c5d1e02c49c67f988b4
5
5
  SHA512:
6
- metadata.gz: 2f47bd6bdf3f5a15867bd69329e507477ec7ea5b15d17282252f4b0760f289fb3559aaded949043a21f8a91039ccfff0f9ac7ff7dec8d2fc30918ac0f9dea1b9
7
- data.tar.gz: 569bc48cfee7d22f12b0aeae89a705c7f2048de20178dd66182479c706677e233ae6e0727f2d0acadb3f8895dad8d814ed7741bcb4e6e0860e7485467363ec56
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?
@@ -1,3 +1,3 @@
1
1
  module RamenRails
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
@@ -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.3
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-07-16 00:00:00.000000000 Z
11
+ date: 2015-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack