active_model_serializers 0.8.2 → 0.8.3

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: ee11c77cee4b5f85a7a31b2ae7fded2ae12dcab1
4
- data.tar.gz: a8a8c430d80820d373fa123dc22199418e7150ee
3
+ metadata.gz: 94274a9d3a573ae8f656719aef33825cabb68673
4
+ data.tar.gz: b1d614a90149ec109b67e963464c232d0b5ed3f1
5
5
  SHA512:
6
- metadata.gz: 3b468f9db91455e90e6f61f12c6168224f59c151e58f51ac54a2a09791daa0160119470154325b0983b7c73f2a4e614c6ac5d29a40e9914ddbdbabba35bd3574
7
- data.tar.gz: 74dff8c032533a17b4e917ff8eaa57a35e19a789f0081294918b6f87619eab7abdc043ff1be9aec2bdaac8ebd38c92d7dfcef7adbc81da8a5e1518ce8b168c3c
6
+ metadata.gz: cc3140d1676014d8ce4aa0add253d247c55652a689cb83e7f7f7a71a81ae8d7c601fc5e2d261d415e243857a479a15156d0a84a67beb1c72475ef51c063cdfca
7
+ data.tar.gz: cfc92ac9bb7dfca07cebdd32ef4a120aa5784cc7f1a6bfc8a65900b553be736b174b6bbf22fb7ebd55e8295ea1d118373245396e3c0ac883e954ab27e925bca2
@@ -20,4 +20,5 @@ Gem::Specification.new do |gem|
20
20
  gem.add_dependency 'activemodel', '>= 3.0'
21
21
  gem.add_development_dependency "rails", ">= 3.0"
22
22
  gem.add_development_dependency "pry"
23
+ gem.add_development_dependency "minitest"
23
24
  end
@@ -33,19 +33,22 @@ module ActionController
33
33
  end
34
34
 
35
35
  def serialization_scope
36
- send(_serialization_scope) if _serialization_scope && respond_to?(_serialization_scope, true)
36
+ send(_serialization_scope) if _serialization_scope &&
37
+ respond_to?(_serialization_scope, true)
37
38
  end
38
39
 
39
40
  def default_serializer_options
40
41
  end
41
42
 
42
- def _render_option_json(resource, options)
43
- json = ActiveModel::Serializer.build_json(self, resource, options)
43
+ [:_render_option_json, :_render_with_renderer_json].each do |renderer_method|
44
+ define_method renderer_method do |resource, options|
45
+ json = ActiveModel::Serializer.build_json(self, resource, options)
44
46
 
45
- if json
46
- super(json, options)
47
- else
48
- super
47
+ if json
48
+ super(json, options)
49
+ else
50
+ super(resource, options)
51
+ end
49
52
  end
50
53
  end
51
54
 
@@ -1,5 +1,5 @@
1
1
  module ActiveModel
2
2
  class Serializer
3
- VERSION = "0.8.2"
3
+ VERSION = "0.8.3"
4
4
  end
5
5
  end
@@ -84,8 +84,6 @@ class RenderJsonTest < ActionController::TestCase
84
84
  end
85
85
 
86
86
  class TestController < ActionController::Base
87
- protect_from_forgery
88
-
89
87
  serialization_scope :current_user
90
88
  attr_reader :current_user
91
89
 
@@ -5,7 +5,7 @@ require "pry"
5
5
 
6
6
  require "active_model_serializers"
7
7
  require "active_support/json"
8
- require "test/unit"
8
+ require "minitest/autorun"
9
9
 
10
10
  require 'rails'
11
11
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_model_serializers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Valim
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-01 00:00:00.000000000 Z
12
+ date: 2014-12-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -53,6 +53,20 @@ dependencies:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: minitest
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
56
70
  description: Making it easy to serialize models for client-side use
57
71
  email:
58
72
  - jose.valim@gmail.com