spyke 3.1.0 → 3.1.1

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: b13b696560677d38ecf376de766cf815d004ea84
4
- data.tar.gz: 50618def09e1ea933d813361baea87342f676a8c
3
+ metadata.gz: ecf530ac97e19a1bc4501b344422a8ab7bf767fb
4
+ data.tar.gz: a7812fed530e51e8ccc07eafb542706cf2fb5738
5
5
  SHA512:
6
- metadata.gz: 575f175c00c78820d6c7f6178522054f8fb0ccf32a8898cac4c776ec715dd68a69572de1ccf329c8f33df2b76d54c095c9c754edb320c7fa72b843ae5803d86c
7
- data.tar.gz: 010b22f6c54164d2d142ec1d83dcd5567f1153f86ae02f739609b6d160c5c55eacb6628c1ce64c3a6215a326e330d8f4e6578da6ccb8a5216de2c80314a2fccb
6
+ metadata.gz: 197cabc723a34557564e432a642d38f6ba52fc337aec08d93c6173d8f5577247f54ee36c634f4c03d8611adb262b602287acbfa3d150553cca1ce5ef0b227bc7
7
+ data.tar.gz: e40149c8f4a69f387244925c18f774c982eecc95e5cfd97d1440243cca5275391f3b38e9820edb4bc1f69e68f9c49446202f6206361ae526494f637f7279c0a6
data/lib/spyke/orm.rb CHANGED
@@ -84,8 +84,8 @@ module Spyke
84
84
  private
85
85
 
86
86
  def param_root
87
- if include_root.is_a? String
88
- include_root
87
+ if [String, Symbol].include?(include_root.class)
88
+ include_root.to_s
89
89
  elsif include_root?
90
90
  self.class.model_name.param_key
91
91
  end
data/lib/spyke/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Spyke
2
- VERSION = '3.1.0'
2
+ VERSION = '3.1.1'
3
3
  end
data/test/orm_test.rb CHANGED
@@ -125,6 +125,7 @@ module Spyke
125
125
 
126
126
  def test_to_params_with_custom_root
127
127
  assert_equal({ 'step_image_root' => { 'url' => 'bob.jpg' } }, StepImage.new(url: 'bob.jpg').to_params)
128
+ assert_equal({ 'foto' => { 'url' => 'bob.jpg' } }, Cookbook::Photo.new(url: 'bob.jpg').to_params)
128
129
  end
129
130
 
130
131
  def test_destroy
@@ -23,6 +23,7 @@ class Recipe < Spyke::Base
23
23
  has_many :groups
24
24
  has_many :gallery_images, class_name: 'Image'
25
25
  has_one :image
26
+ has_many :step_images
26
27
  has_one :background_image, class_name: 'Image', uri: nil
27
28
  has_one :alternate, class_name: 'Recipe', uri: 'recipes/:recipe_id/alternates/recipe'
28
29
  belongs_to :user
@@ -144,5 +145,6 @@ module Cookbook
144
145
  end
145
146
 
146
147
  class Photo < Spyke::Base
148
+ include_root_in_json :foto
147
149
  end
148
150
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spyke
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-22 00:00:00.000000000 Z
11
+ date: 2015-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport