arrest 0.0.68 → 0.0.69

Sign up to get free protection for your applications and to get access to all the features.
@@ -291,8 +291,6 @@ module Arrest
291
291
  old.send("#{f.name}=", rest_resource.send(f.name))
292
292
  end
293
293
 
294
- identify_and_store_edges(@@edge_matrix, rest_resource)
295
-
296
294
  true
297
295
  end
298
296
 
@@ -315,8 +313,6 @@ module Arrest
315
313
  end
316
314
  @@collections[rest_resource.resource_path] << rest_resource.id
317
315
 
318
- identify_and_store_edges(@@edge_matrix, rest_resource)
319
-
320
316
  true
321
317
  end
322
318
 
@@ -85,13 +85,13 @@ module Arrest
85
85
  def scope name, options = {}, &block
86
86
  super(name, options)
87
87
  if block_given?
88
- send :define_singleton_method, name do |context|
89
- self.all(context).select(&block)
88
+ send :define_singleton_method, name do |context, filter = {}|
89
+ self.all(context, filter).select(&block)
90
90
  end
91
91
  else
92
- send :define_singleton_method, name do |context|
92
+ send :define_singleton_method, name do |context, filter = {}|
93
93
  resource_name = options[:resource_name] || name
94
- Arrest::OrderedCollection.new(context, self, self.scoped_path(resource_name))
94
+ Arrest::OrderedCollection.new(context, self, self.scoped_path(resource_name), filter)
95
95
  end
96
96
  end
97
97
 
@@ -1,3 +1,3 @@
1
1
  module Arrest
2
- VERSION = "0.0.68"
2
+ VERSION = "0.0.69"
3
3
  end
@@ -72,26 +72,5 @@ class HasAttributesTest < Test::Unit::TestCase
72
72
  has_many :got_mes, :sub_resource => true
73
73
  end
74
74
 
75
- def test_dirty_attribute
76
- Arrest::Source.source = nil
77
- Arrest::Source.skip_validations = false
78
-
79
- ih = ItHasResource.new({:name => "Bla"})
80
- ih.save
81
- assert !ih.got_me_ids_changed?
82
- assert !ih.changed?
83
-
84
- ih.got_me_ids = ["huhu"]
85
- assert ih.got_me_ids_changed?
86
- assert ih.changed?
87
- ih.save
88
-
89
- assert !ih.got_me_ids_changed?
90
- assert !ih.changed?
91
-
92
- ih.got_me_ids = ["huhu"]
93
- assert !ih.got_me_ids_changed?
94
- assert !ih.changed?
95
- end
96
75
  end
97
76
 
@@ -455,25 +455,6 @@ class FirstTest < Test::Unit::TestCase
455
455
  assert all.empty?, "After deletion all entities should have been removed"
456
456
  end
457
457
 
458
- def test_update_belongs_to
459
- f1 = @scope.Foo.new()
460
- f1.save
461
- assert_equal 0, Arrest::Source.source.edge_count
462
- b1 = @scope.Bar.new({:foo_id => f1.id})
463
- b1.save
464
- assert_equal 2, Arrest::Source.source.edge_count
465
- assert_equal 2, Arrest::Source.source.node_count
466
-
467
- f2 = @scope.Foo.new()
468
- f2.save
469
- assert_equal 2, Arrest::Source.source.edge_count
470
- b1.foo_id = f2.id
471
- b1.save
472
- #Arrest::Source.source.edge_matrix.each_pair{|k,v| y k; y v}
473
- assert_equal 2, Arrest::Source.source.edge_count
474
- assert_equal 3, Arrest::Source.source.node_count
475
- end
476
-
477
458
 
478
459
  def test_equality_non_persistent
479
460
  zoo1 = @scope.Zoo.new(:name => 'zoo1')
@@ -517,20 +498,6 @@ class FirstTest < Test::Unit::TestCase
517
498
  assert_equal zoo1, zoo1_reloaded, "Objects of the same class with the same id should be equal even if they differ in attributes (same as in rails)"
518
499
  end
519
500
 
520
- def test_has_many_sub_resource_attr_setter
521
- b = @scope.BarWithHasManySubResource.new()
522
- b.save
523
-
524
- assert_raise ArgumentError do
525
- b.foo_ids = nil
526
- end
527
-
528
- assert_raise ArgumentError do
529
- b.foo_ids = "Tralala"
530
- end
531
-
532
- b.foo_ids = []
533
- end
534
501
 
535
502
  def test_update_attribute
536
503
  zoo1 = @scope.Zoo.new(:name => 'zoo1')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.68
4
+ version: 0.0.69
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-20 00:00:00.000000000Z
12
+ date: 2012-06-25 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &25743060 !ruby/object:Gem::Requirement
16
+ requirement: &13273340 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *25743060
24
+ version_requirements: *13273340
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: faraday
27
- requirement: &25742560 !ruby/object:Gem::Requirement
27
+ requirement: &13272840 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.7.5
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *25742560
35
+ version_requirements: *13272840
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activemodel
38
- requirement: &25742060 !ruby/object:Gem::Requirement
38
+ requirement: &13272340 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '3'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *25742060
46
+ version_requirements: *13272340
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
- requirement: &25741600 !ruby/object:Gem::Requirement
49
+ requirement: &13271880 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.0.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *25741600
57
+ version_requirements: *13271880
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rake
60
- requirement: &25741220 !ruby/object:Gem::Requirement
60
+ requirement: &13271500 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *25741220
68
+ version_requirements: *13271500
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rdoc
71
- requirement: &25740760 !ruby/object:Gem::Requirement
71
+ requirement: &13271040 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *25740760
79
+ version_requirements: *13271040
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &25740260 !ruby/object:Gem::Requirement
82
+ requirement: &13270540 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '2'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *25740260
90
+ version_requirements: *13270540
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rr
93
- requirement: &25739840 !ruby/object:Gem::Requirement
93
+ requirement: &13270120 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *25739840
101
+ version_requirements: *13270120
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: simplecov
104
- requirement: &25739380 !ruby/object:Gem::Requirement
104
+ requirement: &13269660 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *25739380
112
+ version_requirements: *13269660
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rack
115
- requirement: &25738960 !ruby/object:Gem::Requirement
115
+ requirement: &13269240 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,7 +120,7 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *25738960
123
+ version_requirements: *13269240
124
124
  description: Consume a rest API in a AR like fashion
125
125
  email:
126
126
  - axel.tetzlaff@fortytools.com