contentful_model 0.0.6.1 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: debd876c418d9b40d60d26290eebf31e4e78f261
4
- data.tar.gz: 05e264df3ae39318b947aa3e9ac94b694dc1329b
3
+ metadata.gz: f1199c6bcfa0312db762ee9d3a5873dbe082db12
4
+ data.tar.gz: c9ddc557291ce3eaca06cd860f53e2d1ad4a6401
5
5
  SHA512:
6
- metadata.gz: 138a61fc9dc6ae006ee0088858d6fd0fd7bb1eee25bd6b088c0c3ca1566ceab04f4f07a644c6ea5a8bf8bd55cfe216bcd34275fdea223d599fb615360e6d8b23
7
- data.tar.gz: b168b15e0e670bcbb37efe7a133604a49806212e261a5306af47d227d84b27aaca0503c28936cbcf7267edbed21e4e9804d2036d8f9a6d6648e328938518d3b5
6
+ metadata.gz: b577849558fb930dbf9479b620f7bfcdde58712eed7ba961dbb1edffd9d385cd0f0c3cde3cc3e9c805f92b7a8b9b7ffbfcc74dc5ba5794a713b8d2dff92d82d4
7
+ data.tar.gz: 1c64cc844615b9dc4d8c187d54fa650ca0ae71d9640a12f2c35e75a283153dc06e15278eb55d005f57492ebc1c1270076c5e8dca5726776f1a7ca6f21c8d8208
@@ -8,10 +8,10 @@ module ContentfulModel
8
8
  end
9
9
 
10
10
  #use method_missing to call fields on the model
11
- def method_missing(method)
11
+ def method_missing(method, *args, &block)
12
12
  result = fields[:"#{method.to_s.camelize(:lower)}"]
13
13
  if result.nil?
14
- raise NoMethodError, "No method or attribute #{method} for #{self}"
14
+ super
15
15
  else
16
16
  if self.class.coercions[method].nil?
17
17
  return result
@@ -21,6 +21,14 @@ module ContentfulModel
21
21
  end
22
22
  end
23
23
 
24
+ def respond_to_missing?(method, private=false)
25
+ if fields[:"#{method.to_s.camelize(:lower)}"].nil?
26
+ super
27
+ else
28
+ true
29
+ end
30
+ end
31
+
24
32
  def cache_key(*timestamp_names)
25
33
  if timestamp_names.present?
26
34
  raise ArgumentError, "ContentfulModel::Base models don't support named timestamps."
@@ -8,6 +8,7 @@ module ContentfulModel
8
8
 
9
9
  def inherited(subclass)
10
10
  instantiate_query(subclass)
11
+ subclass.send(:attr_reader,:query)
11
12
  end
12
13
 
13
14
  def instantiate_query(klass)
@@ -1,3 +1,3 @@
1
1
  module ContentfulModel
2
- VERSION = "0.0.6.1"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6.1
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Error Creative Studio