active_model_exporters 0.2.0 → 0.3.0

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: a27f64330b23e828ecb9d05f2cdd49025ea0c9d4
4
- data.tar.gz: d81cb5038d1ec1010533550bfec9d468bcffac8e
3
+ metadata.gz: 0378a96ebc63c714524b298cbf7b33c431e3ee7f
4
+ data.tar.gz: a6d3e85fa50c76ff0d949548eeee2a20496daa70
5
5
  SHA512:
6
- metadata.gz: c113d73e072c1cfffc042c11fb6b8b1e3312ca09f990ebf6bf9776a30eba5627c384e0ad412c7f7b23b96c49380b433468d43616ce7659240c13501a7182d4f9
7
- data.tar.gz: 203f64c80b8def0e65a170c4656fd4d9ac7d0e96e0ba9397b72ac4ceab1afdc9842e1615bc7f33e1bee00e3ebc729e4ac148131c29e9146d51d2b446c9c70b2e
6
+ metadata.gz: a35fa0e950ee7253fe7f040b9909753a7802814d578229cbcd3e67ccea6d15975f93aa5bb8bdd3bfff2d603bbde8052251869334744c61a1295df7518c113fb5
7
+ data.tar.gz: 19ead28f4367fb080f350ab031d3245b9580f32235fe8b6ca7bf1ce64ee718de7cfba4254b617640bc975e48fe5359fe5ac124b521f9c9ed1036e5e174cff866
data/README.md CHANGED
@@ -37,18 +37,6 @@ class PostsController < ApplicationController
37
37
  end
38
38
  ```
39
39
 
40
- Or:
41
- ```ruby
42
- class PostsController < ApplicationController
43
- respond_to :csv, :xls
44
-
45
- def index
46
- @posts = Post.all
47
- respond_with @posts
48
- end
49
- end
50
- ```
51
-
52
40
  ### Custom exporter
53
41
  To specify a custom exporter for each object, you can do the next in your controller:
54
42
  ```ruby
@@ -83,7 +71,7 @@ end
83
71
  ### Exporter scope
84
72
 
85
73
  #### 1. Default scope
86
- As `ActiveModel::Serializers` does, you can access to the current user application via `scope`.
74
+ As `ActiveModel::Serializers` does, you can access to the current user via `scope`.
87
75
  ```ruby
88
76
  class UserExporter < ActiveModel::Exporter
89
77
  attributes :name, :email
@@ -137,4 +125,4 @@ Rejected attributes will be blank in the downloaded file.
137
125
 
138
126
  New feature or code refactoring? Submit a pull request that implements it. Don't forget to write your tests and include a CHANGELOG with your updates.
139
127
 
140
- Thank you :heart:
128
+ Thank you!
@@ -14,9 +14,11 @@ module ActionController
14
14
  end
15
15
 
16
16
  ActiveModel::Exporter::TYPES.each do |type|
17
- define_method "_render_option_#{type}" do |resource, options|
18
- exporter = build_exporter(resource, options)
19
- exporter ? super(exporter, options) : super
17
+ [:_render_option_, :_render_with_renderer_json].each do |prefix|
18
+ define_method "#{prefix}#{type}" do |resource, options|
19
+ exporter = build_exporter(resource, options)
20
+ exporter ? super(exporter, options) : super
21
+ end
20
22
  end
21
23
  end
22
24
 
@@ -1,5 +1,5 @@
1
1
  module ActiveModel
2
2
  class Exporter
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_model_exporters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Gutiérrez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-14 00:00:00.000000000 Z
11
+ date: 2015-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel