pupper 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pupper/model.rb +5 -16
- data/lib/pupper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b10ca67f34d9a231bdfb103eb0dec6a55c07a448
|
4
|
+
data.tar.gz: 990091a1fcab063c36f9dcfcac7e2e437eb855c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aabd06af0c83891b53dc4b4a71a472cf290b6f3e34e96a22a38483f0b286cd9cb8b3f42e134c46284651cab452c2b6c884e1a9a0b0b266fa2c6a8e453a40537d
|
7
|
+
data.tar.gz: 37a20ff365d374b67feeb9942e277c340c233be4b659229280efde4859d0782993aed811b1e64d5fc696e589c98ea94c32e3df361da115e4729b2bd6fdc4042c
|
data/lib/pupper/model.rb
CHANGED
@@ -29,7 +29,7 @@ module Pupper
|
|
29
29
|
|
30
30
|
changes_applied
|
31
31
|
|
32
|
-
backend.register_model(self)
|
32
|
+
backend.register_model(self) unless static?
|
33
33
|
end
|
34
34
|
|
35
35
|
def primary_key
|
@@ -66,24 +66,13 @@ module Pupper
|
|
66
66
|
def backend
|
67
67
|
return if static?
|
68
68
|
@backend ||= "#{model_name.name.pluralize}Client".constantize.new
|
69
|
-
rescue NameError
|
70
|
-
raise NoSuchBackend, <<-ERR
|
71
|
-
Model #{model_name.name} is looking for an API client that doesn't exist!
|
72
|
-
|
73
|
-
Either a) implement the new client:
|
74
|
-
|
75
|
-
# app/api_clients/#{model_name.name.sub('::', '/').downcase.pluralize}_client.rb
|
76
|
-
class #{model_name.name.pluralize}Client < Pupper::Backend
|
77
|
-
end
|
78
|
-
|
79
|
-
Or b) use a different client instead
|
80
|
-
|
81
|
-
self.backend = Other::BackendClient
|
82
|
-
|
83
|
-
ERR
|
84
69
|
end
|
85
70
|
end
|
86
71
|
|
72
|
+
def static?
|
73
|
+
self.class.static?
|
74
|
+
end
|
75
|
+
|
87
76
|
def to_json(*)
|
88
77
|
attributes.except(*excluded_attrs).to_json
|
89
78
|
end
|
data/lib/pupper/version.rb
CHANGED