activeresource 2.3.18 → 3.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activeresource might be problematic. Click here for more details.
- data/CHANGELOG +1 -29
- data/README +7 -7
- data/examples/simple.rb +15 -0
- data/lib/active_resource.rb +17 -17
- data/lib/active_resource/base.rb +320 -66
- data/lib/active_resource/connection.rb +100 -100
- data/lib/active_resource/custom_methods.rb +33 -36
- data/lib/active_resource/exceptions.rb +4 -1
- data/lib/active_resource/formats.rb +4 -4
- data/lib/active_resource/formats/json_format.rb +2 -0
- data/lib/active_resource/formats/xml_format.rb +2 -0
- data/lib/active_resource/http_mock.rb +12 -103
- data/lib/active_resource/observing.rb +21 -0
- data/lib/active_resource/railtie.rb +17 -0
- data/lib/active_resource/railties/subscriber.rb +15 -0
- data/lib/active_resource/schema.rb +55 -0
- data/lib/active_resource/validations.rb +66 -215
- data/lib/active_resource/version.rb +3 -3
- metadata +29 -43
- data/Rakefile +0 -137
- data/lib/activeresource.rb +0 -2
- data/test/abstract_unit.rb +0 -21
- data/test/authorization_test.rb +0 -122
- data/test/base/custom_methods_test.rb +0 -100
- data/test/base/equality_test.rb +0 -52
- data/test/base/load_test.rb +0 -161
- data/test/base_errors_test.rb +0 -98
- data/test/base_test.rb +0 -1087
- data/test/connection_test.rb +0 -238
- data/test/fixtures/beast.rb +0 -14
- data/test/fixtures/customer.rb +0 -3
- data/test/fixtures/person.rb +0 -3
- data/test/fixtures/proxy.rb +0 -4
- data/test/fixtures/street_address.rb +0 -4
- data/test/format_test.rb +0 -112
- data/test/http_mock_test.rb +0 -155
- data/test/setter_trap.rb +0 -26
data/test/setter_trap.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
class SetterTrap < ActiveSupport::BasicObject
|
2
|
-
class << self
|
3
|
-
def rollback_sets(obj)
|
4
|
-
trapped = new(obj)
|
5
|
-
yield(trapped).tap { trapped.rollback_sets }
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
def initialize(obj)
|
10
|
-
@cache = {}
|
11
|
-
@obj = obj
|
12
|
-
end
|
13
|
-
|
14
|
-
def respond_to?(method)
|
15
|
-
@obj.respond_to?(method)
|
16
|
-
end
|
17
|
-
|
18
|
-
def method_missing(method, *args, &proc)
|
19
|
-
@cache[method] ||= @obj.send($`) if method.to_s =~ /=$/
|
20
|
-
@obj.send method, *args, &proc
|
21
|
-
end
|
22
|
-
|
23
|
-
def rollback_sets
|
24
|
-
@cache.each { |k, v| @obj.send k, v }
|
25
|
-
end
|
26
|
-
end
|