giraffesoft-classy_resources 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 0
2
+ :patch: 1
3
3
  :major: 0
4
4
  :minor: 1
@@ -13,7 +13,7 @@ module ClassyResources
13
13
  end
14
14
 
15
15
  def create_nested_object(resource, object_params, parent)
16
- c = create_shallow_object(resource, object_params)
16
+ c = class_for(resource).new(object_params)
17
17
  load_parent_object(parent).send(:"add_#{resource.to_s.singularize}", c)
18
18
  end
19
19
 
@@ -24,6 +24,7 @@ end
24
24
 
25
25
  class Subscription < Sequel::Model(:subscriptions)
26
26
  many_to_one :users
27
+ validates_presence_of :user_id
27
28
  end
28
29
 
29
30
  define_resource :users, :collection => [:get, :post],
data/test/sequel_test.rb CHANGED
@@ -77,8 +77,8 @@ class SequelTest < Test::Unit::TestCase
77
77
  context "on GET to /users/id/comments" do
78
78
  setup do
79
79
  @user = create_user
80
- 2.times { @user.add_subscription(create_subscription) }
81
- 2.times { create_subscription }
80
+ 2.times { @user.add_subscription(Subscription.new(hash_for_subscription)) }
81
+ 2.times { create_subscription(:user_id => 9) }
82
82
  get "/users/#{@user.id}/subscriptions.xml"
83
83
  end
84
84
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: giraffesoft-classy_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Golick