store_model 0.5.0 → 0.5.1

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
  SHA256:
3
- metadata.gz: a99c1037fc868b8aa6af066eed972678b202a806095eb992ae618fa66a0ea97a
4
- data.tar.gz: 9690b9e4805b6c5164a47dc61396f66557e1da13c59d8619193b727b4c283116
3
+ metadata.gz: 3e08694a9eb910d42bd5c9a1f6f2b23746494aad264315e8b7c1de863148fb72
4
+ data.tar.gz: e5fd75336b9c22c9b75a5de967e2019e54bef594ff7d526fa56dc0ccdac9237e
5
5
  SHA512:
6
- metadata.gz: 3d1dbc66827d62afb4e1e3d527f0a1e7f928485b488483d16f91817fb472a3a47fb8ff907d841a542660996b9c2778e2a824cd4b5362c720ea65ff9aac36470e
7
- data.tar.gz: 043b85616f5350e02005bc771687a0d893a949329963f63f67c4a59d7ef26a897a596539490aed6d16a3b56ea8741559226c8dc6d7dfba4d57492c48b886fc15
6
+ metadata.gz: b229005093bd41076d547b093880954c060623ce2906b782e7e675ae5416b7f27b5876172d16d137d4be33a521449a196f30f170b946df174e4b0732ebad16a1
7
+ data.tar.gz: 5add920a20c6b2f56121fe360c70f878de2ea194f7a0e5347168a5d9e4f72a7eed660d4966b8b4b0476c57fe90e99425da9b219abc59f7b487a91b21679bbddf
@@ -36,9 +36,18 @@ module StoreModel
36
36
  "#<#{self.class.name} #{attribute_string}>"
37
37
  end
38
38
 
39
- def type_for_attribute(attribute)
40
- self.class.attribute_types[attribute.to_s]
39
+ delegate :attribute_types, to: :class
40
+
41
+ def type_for_attribute(attr_name)
42
+ attr_name = attr_name.to_s
43
+ attribute_types[attr_name]
44
+ end
45
+
46
+ # rubocop:disable Naming/PredicateName
47
+ def has_attribute?(attr_name)
48
+ attribute_types.key?(attr_name.to_s)
41
49
  end
50
+ # rubocop:enable Naming/PredicateName
42
51
 
43
52
  def unknown_attributes
44
53
  @unknown_attributes ||= {}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StoreModel
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: store_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DmitryTsepelev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-05 00:00:00.000000000 Z
11
+ date: 2019-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails