pupper 0.1.6 → 0.1.7

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: 7a62184fec598d738bce908d70bda3ed8bfe67fc
4
- data.tar.gz: 36fd57180f47804e668cf990e5405479fef0b4c0
3
+ metadata.gz: 691ae8c03c3853270c769eeb8f2843c58fd35e69
4
+ data.tar.gz: 1226c5952381f25be872736d53c46b8f5f77c4ea
5
5
  SHA512:
6
- metadata.gz: 344c3b100cfd6c65e0f7f7f4b024acfca96f4abe2cbae345715d3a200cb0207c37253c65d3db59df5b6f93a936fe51a8b721e2b4e45edc20e5c52f13e285e7c6
7
- data.tar.gz: 79242a4a88e9c0d0131e700d64ec85b174a707b6e0b1a3bc01f1c726b9815d608d8846bb795ab588a6ddcf9518662f672f803a857b4eb83000eda61db3bab76e
6
+ metadata.gz: 21197fda988bfd1f751c54a56ac3fd22d871fcb1bbf883992edfa3d92ac9363348bb8e2dcc056339536dc0c130ffaeb06db0176c29e7c3f41817c2acf3c66376
7
+ data.tar.gz: eb940c6c849d64ac3062a3479201a55e288230007d83cd52bf24084df55bb778d6d6750f1d876914a4c45b5de18ca1f8389242a882de63267ccb87e24c4f4959
@@ -7,12 +7,12 @@ module Pupper
7
7
  @associations ||= { has_one: [], has_many: [] }
8
8
  end
9
9
 
10
- def has_one(assoc)
11
- associations[:has_one] << assoc
10
+ def has_one(*assocs)
11
+ associations[:has_one].concat(assocs)
12
12
  end
13
13
 
14
- def has_many(assoc)
15
- associations[:has_many] << assoc
14
+ def has_many(*assocs)
15
+ associations[:has_many].concat(assocs)
16
16
  end
17
17
  end
18
18
 
@@ -34,11 +34,8 @@ module Pupper
34
34
 
35
35
  def create_attribute(name, foreign_key = nil, value = nil)
36
36
  self.class.attr_accessor(name)
37
-
38
- return unless foreign_key.present?
39
-
40
37
  excluded_attrs << name if foreign_key.present?
41
- send("#{name}#{foreign_key.prepend('_')}=", value)
38
+ send("#{name}=", value)
42
39
  end
43
40
 
44
41
  def find_assoc_type(name)
@@ -1,3 +1,3 @@
1
1
  module Pupper
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
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.1.6
4
+ version: 0.1.7
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-02-20 00:00:00.000000000 Z
11
+ date: 2017-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler