ddc 0.1.3 → 0.1.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: b5a636539bd001d456101a2ba453beaf34f03c79
4
- data.tar.gz: 0b0dfc64396cbe21c7d0a9d8d1e24b99b0649648
3
+ metadata.gz: 47db88316f12256bf011cba49ba908240c03ae22
4
+ data.tar.gz: 8be0483b5cb162c19e64e1c9e5961f6def051ecc
5
5
  SHA512:
6
- metadata.gz: 73e58a273638f57fce3500fc38e504c3ff73bce43069842033a508b2630adbeb630883c1e89baa058fd919b6c599021020d5ae87b0db9cebd9a62086b232107d
7
- data.tar.gz: 0f34ccfd5550fc48c4c8ac5bb90c689c188ec25a1ebb0a7041a04900728580f134bd4702cdcfd51722f4bf45a58509e7d092b703554481d6b5a0bc1b7103f27d
6
+ metadata.gz: fd48fbdcba04e2d1d3243c43df3e40db755aad4bd514b314f4a2d57e7d2cfadcbb59cb6345eeb213dd3a1338743b2436007b37d3bba6209392e9a95f1d7748e6
7
+ data.tar.gz: f3b76c51dc6e8f2f81bdb5f36aae083045fa103bbd7b0045350aa9d46cb9c156a386d1dc666332da98f04279a672918a18e0fdbdd25cbfb906833ca956759901
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
+ tags
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # DDC Changelog
2
2
 
3
+ ### 0.1.4
4
+
5
+ * remove :serializer and :each_serializer, use :render_opts to pass a hash
6
+
7
+ ### 0.1.2
8
+
9
+ * add :serializer and :each_serializer as action options
10
+
3
11
  ### 0.1.1
4
12
 
5
13
  * Fix update status code
@@ -22,11 +22,11 @@ module DDC
22
22
  def find_or_create_class(controller_name)
23
23
  controller_klass_name = controller_name.to_s.camelize+'Controller'
24
24
  klass = nil
25
- if Object.constants.include?(controller_klass_name.to_sym)
26
- klass = Object.const_get(controller_klass_name)
25
+ if Object.qualified_const_defined?(controller_klass_name)
26
+ klass = Object.qualified_const_get(controller_klass_name)
27
27
  else
28
28
  klass = Class.new(ApplicationController)
29
- Object.const_set(controller_klass_name, klass)
29
+ Object.qualified_const_set(controller_klass_name, klass)
30
30
  end
31
31
  end
32
32
 
@@ -76,14 +76,13 @@ module DDC
76
76
  respond_to do |format|
77
77
  format.json do
78
78
  if obj.nil?
79
- render_opts = {
79
+ render_opts = {
80
80
  json: {errors: errors}, status: status }
81
81
  else
82
82
  render_opts = { json: obj, status: status }
83
83
  end
84
84
 
85
- render_opts[:serializer] = action_desc[:serializer] if action_desc.has_key? :serializer
86
- render_opts[:each_serializer] = action_desc[:each_serializer] if action_desc.has_key? :each_serializer
85
+ render_opts = (action_desc[:render_opts]).merge(render_opts) if action_desc.has_key? :render_opts
87
86
  render render_opts
88
87
  end
89
88
  format.html do
data/lib/ddc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ddc
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -192,7 +192,9 @@ describe DDC::ControllerBuilder do
192
192
  index: {
193
193
  context: 'foo_context_builder#bar',
194
194
  service: 'baz_service#qux',
195
- serializer: MySerializer
195
+ render_opts: {
196
+ serializer: MySerializer
197
+ }
196
198
  }
197
199
 
198
200
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shawn Anderson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-04 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler