superdupe 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
data/lib/superdupe/dupe.rb
CHANGED
@@ -260,7 +260,7 @@ class Dupe
|
|
260
260
|
# <name>Robert Heinlein</name>
|
261
261
|
# </author>
|
262
262
|
def create(model_name, records={})
|
263
|
-
model_name = model_name.to_s.
|
263
|
+
model_name = model_name.to_s.to_sym
|
264
264
|
define model_name unless model_exists(model_name)
|
265
265
|
records = records.kind_of?(Array) ? records.map {|r| r.symbolize_keys} : records.symbolize_keys!
|
266
266
|
create_and_insert records, :into => model_name
|
@@ -1,21 +1,21 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
module Ns
|
4
|
-
class Ns::
|
4
|
+
class Ns::Address < ActiveResource::Base
|
5
5
|
self.site = ''
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
|
-
describe Ns::
|
9
|
+
describe Ns::Address do
|
10
10
|
|
11
11
|
context "creating and saving a namespaced resource" do
|
12
12
|
it 'should allow to first instantiate and then save a resource' do
|
13
|
-
Dupe.define :"Ns::
|
14
|
-
Ns::
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
Ns::
|
13
|
+
Dupe.define :"Ns::Address"
|
14
|
+
Ns::Address.find(:all).size.should be(0)
|
15
|
+
new_address = Ns::Address.new
|
16
|
+
new_address.save
|
17
|
+
new_address.id.should_not be_nil
|
18
|
+
Ns::Address.find(:all).size.should be(1)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superdupe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 4
|
10
|
+
version: 1.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Marco Ribi
|
@@ -16,14 +16,11 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-09-
|
19
|
+
date: 2010-09-16 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
|
-
|
24
|
-
prerelease: false
|
25
|
-
name: activeresource
|
26
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
27
24
|
none: false
|
28
25
|
requirements:
|
29
26
|
- - ">="
|
@@ -34,7 +31,10 @@ dependencies:
|
|
34
31
|
- 3
|
35
32
|
- 3
|
36
33
|
version: 2.3.3
|
37
|
-
|
34
|
+
type: :runtime
|
35
|
+
name: activeresource
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: *id001
|
38
38
|
description: |-
|
39
39
|
SuperDupe is a fork of the originally Dupe and rides on top of ActiveResource to allow you to cuke the client side of
|
40
40
|
a service-oriented app without having to worry about whether or not the service is live or available while cuking.
|