pupper 0.2.0 → 0.2.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
  SHA1:
3
- metadata.gz: d34dc2ba64de639036eb23d7bedb6e04ce1d9f12
4
- data.tar.gz: d9e8f140ffc3148c54cac9b070ff09f651ca16ec
3
+ metadata.gz: 076ade035c194893ca835d7a83d587f24c7bf424
4
+ data.tar.gz: f2a63deb8e3fe6e390163fcb395fcd06c53a3585
5
5
  SHA512:
6
- metadata.gz: 9b59fa6e816dddca58b812fc823a642876e09f10e2d4a5dd9091a1a871194c6fe95f4dac494d3e7167d529412e399df4dd5a65812b85732ac86a3738974069a4
7
- data.tar.gz: b70f8f26c85643ba8c75bd142760c574e45596c8457ff5d19a3a63638fa1a50f9ef2228a0423e82232979c08298c1f631c9ccf5abc7a1afa6acfb6f52dc068e1
6
+ metadata.gz: dde6f826c686fb59b1fb176454982503ec1952ed8258fcfc659477a876a3abfce3e70380c87ce59f3cc3d114da2845e5b5f58c51767de5d3bd631836354cd561
7
+ data.tar.gz: 73231d2f3bf3e59e42ec331daf9b3448d5fba38de6cc4c5785b3177d0c7e18dc1f0fa3d21afbb94c8b9ce5e22e1547b5bc1cc0e3be762f1aa1c4bc0cbf66927e
data/lib/pupper/model.rb CHANGED
@@ -19,6 +19,8 @@ module Pupper
19
19
  delegate :backend, to: :class
20
20
 
21
21
  def initialize(**args)
22
+ args.slice!(*self.class._attributes)
23
+
22
24
  assocs, attrs = args.partition do |attr, value|
23
25
  attr.to_s =~ /_u?id$/ || value.is_a?(Hash) || value.is_a?(Array)
24
26
  end.map(&Hash.method(:[]))
@@ -45,7 +45,7 @@ module Pupper
45
45
  # override the default so that we can hook into the created methods
46
46
  define_attribute_methods(*attrs)
47
47
 
48
- _attributes << attrs
48
+ _attributes.concat(attrs)
49
49
 
50
50
  attrs.each do |attr|
51
51
  define_method attr do
@@ -1,3 +1,3 @@
1
1
  module Pupper
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/pupper.gemspec CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency 'byebug'
25
25
  spec.add_development_dependency 'rake', '~> 10.0'
26
26
  spec.add_development_dependency 'rspec'
27
+ spec.add_development_dependency 'rspec-activemodel-mocks'
27
28
  spec.add_development_dependency 'pry'
28
29
  spec.add_development_dependency 'pry-byebug'
29
30
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pupper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Machin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-02 00:00:00.000000000 Z
11
+ date: 2017-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec-activemodel-mocks
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: pry
71
85
  requirement: !ruby/object:Gem::Requirement