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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da1228421c6ae38ceac9673bba44acaec488541a
4
- data.tar.gz: 80ca69cc2e867f6bea0d49c389e70ebd07df1200
3
+ metadata.gz: b10ca67f34d9a231bdfb103eb0dec6a55c07a448
4
+ data.tar.gz: 990091a1fcab063c36f9dcfcac7e2e437eb855c7
5
5
  SHA512:
6
- metadata.gz: c3bb052ba41f3ea2c7ec9f4e6d33e97fb764f39ef6c8d78645880a55038e62deba6fb4a23701cbdaea283401f111907e955531759423a2fbacb2b33b952b6966
7
- data.tar.gz: 8fa6107e50e9083ea058a88e6c338514e237e13ca72cbd847b3d544f0380d2a78f8bb34353c94d636140c7b8bf2832cd2932d209ed1b174bffac05075c82cee9
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
@@ -1,3 +1,3 @@
1
1
  module Pupper
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pupper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Machin