cowtech-rails 2.2.3.1 → 2.2.3.2

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.
@@ -52,11 +52,7 @@ module Cowtech
52
52
  end
53
53
 
54
54
  def _normalize_type(format = nil)
55
- if format != nil then
56
- request.format = format
57
- else
58
- request.format = :text if request.format != :json
59
- end
55
+ format = :text if !([:text, :json, :jsonp].include?(format))
60
56
  end
61
57
 
62
58
  def setup_json_response(type = :base)
@@ -66,13 +62,14 @@ module Cowtech
66
62
  def custom_respond_with(data, format = nil, status = :ok)
67
63
  return if performed?
68
64
 
69
- self._normalize_type(format)
65
+ format = request.format if format.blank?
66
+ format = self._normalize_type(format)
70
67
 
71
- if request.format == :text then
68
+ if format == :text then
72
69
  render :text => data, :status => status
73
- elsif request.format == :json then
70
+ elsif format == :json then
74
71
  render :json => data, :status => status
75
- elsif request.format == :jsonp then
72
+ elsif format == :jsonp then
76
73
  render :json => data, :status => status, :callback => params[:callback]
77
74
  end
78
75
  end
@@ -10,7 +10,7 @@ module Cowtech
10
10
  MAJOR = 2
11
11
  MINOR = 2
12
12
  PATCH = 3
13
- BUILD = 1
13
+ BUILD = 2
14
14
 
15
15
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
16
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cowtech-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3.1
4
+ version: 2.2.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-20 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cowtech-extensions
16
- requirement: &70133297661680 !ruby/object:Gem::Requirement
16
+ requirement: &70116894281020 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70133297661680
24
+ version_requirements: *70116894281020
25
25
  description: A general purpose Rails utility plugin.
26
26
  email: shogun_panda@me.com
27
27
  executables: []