pickle-dupe 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -0
- data/VERSION +1 -1
- data/lib/pickle_dupe/adapter.rb +4 -2
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -16,6 +16,10 @@ In order to use pickle with dupe, you need to add :dupe to your pickle's configu
|
|
16
16
|
Pickle.configure do |config|
|
17
17
|
config.adapters = [:dupe]
|
18
18
|
end
|
19
|
+
|
20
|
+
== TODO
|
21
|
+
* Spec for dynamically creating ActiveResource model when there is dupe definition but no model defined, making sure the
|
22
|
+
site value is set.
|
19
23
|
|
20
24
|
== Copyright
|
21
25
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/lib/pickle_dupe/adapter.rb
CHANGED
@@ -20,14 +20,16 @@ module Pickle
|
|
20
20
|
# Not all dupe models has an associated model class
|
21
21
|
# so we dynamically create them here
|
22
22
|
unless @klass = (model.name.to_s.classify.constantize rescue nil)
|
23
|
-
Object.const_set(model.name.to_s.classify, Class.new(ActiveResource::Base))
|
23
|
+
class_handler = Object.const_set(model.name.to_s.classify, Class.new(ActiveResource::Base))
|
24
|
+
class_handler.site = 'http://test.com'
|
25
|
+
puts "WARNING: #{model.name} model is defined dynamically because there was a dupe definition but no model was defined"
|
24
26
|
end
|
25
27
|
@name = model.name.to_s
|
26
28
|
end
|
27
29
|
|
28
30
|
def create(attrs = {})
|
29
31
|
duped_object = ::Dupe.create(@name, attrs)
|
30
|
-
assign_missing_associations
|
32
|
+
assign_missing_associations(duped_object, attrs) unless attrs.blank?
|
31
33
|
|
32
34
|
return duped_object
|
33
35
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 2
|
9
|
+
version: 0.2.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- iawgens
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-07 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|