refer 0.1.0 → 0.1.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: 736ad28aa8233ae7dd3de16fe4f735931fa626b24f2875d2f60ac0d2791e1c05
4
- data.tar.gz: c114325825aebd3e62fc5f2a0f29cf8ec7b562b646b2597c326a6631efd5920e
3
+ metadata.gz: e93783086c4e2c9c226868f818915d002d13258e4a1dc024759921b75763fa5e
4
+ data.tar.gz: 0477c633957d41edad55c6da672b2ca3fcca1b9a87ea2414e65cf0c6309a458a
5
5
  SHA512:
6
- metadata.gz: 2929027d9b24206e3ed98c6e6b8858bc5efa9e0df3c094edd272dd80c318f764fe83761a6540d045faf6f9628adf537e94109e4fc88b9108ffb2b71d91fa3969
7
- data.tar.gz: ab6a96074eba0db0bd0319c4233aae91418a506182dc93ccf6937debd1a8f909a20485fbd238defa6d3ebf261d866554783360d1c16a634c1b25e3330cfce670
6
+ metadata.gz: 6149724a00b0600711afc17d9a035c3f048134b41873f0b44d036cfdd4fbd787182e31f607397034f2b65279eb6130e9c5702677fa0987e32a98bd284d26c32b
7
+ data.tar.gz: '0562961b931e111932027ba64bbce8f598ad2a85098ac308a874ec5429549d5e6bfdbfca1c8df00d16a7e9d08e154a8043d4d11ccf1b32ea1920e0b0f2376c4e'
@@ -3,8 +3,9 @@ module Refer
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- has_many :referrals, inverse_of: :referrer, class_name: "Refer::Referral"
7
- has_one :referral, inverse_of: :referee, class_name: "Refer::Referral"
6
+ has_many :referral_codes, inverse_of: :referrer, class_name: "Refer::ReferralCode", dependent: :destroy
7
+ has_many :referrals, inverse_of: :referrer, class_name: "Refer::Referral", dependent: :destroy
8
+ has_one :referral, inverse_of: :referee, class_name: "Refer::Referral", dependent: :destroy
8
9
  delegate :referrer, to: :referral
9
10
  end
10
11
  end
@@ -1,7 +1,7 @@
1
1
  module Refer
2
2
  class ReferralCode < ApplicationRecord
3
3
  belongs_to :referrer, polymorphic: true
4
- has_many :referrals
4
+ has_many :referrals, dependent: :nullify
5
5
 
6
6
  validates :code, presence: true, uniqueness: true
7
7
 
data/lib/refer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Refer
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver