bullet_train 1.4.11 → 1.5.0

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
  SHA256:
3
- metadata.gz: 140dbaf8f86eba011c5c4e5b5a01a6901d4ab16b669acbffeed08a3dc75f5dfb
4
- data.tar.gz: 9a1153ecb4219a98ee472aa6f56a2ac1070f2f893f79735112fad5d17464bb74
3
+ metadata.gz: ab2b266dbfce24f8790dbee6a5f2236dd54c4d91e4064c87a82c44b38c05e3d0
4
+ data.tar.gz: 4380916c8f6ebc3666d49b34c6fa8034801b3f340e1f4eabd23c790cbe3ded37
5
5
  SHA512:
6
- metadata.gz: aaee080da3b6620766f71c0f9c064640246f392b1a95d20451dbb205182ba2c2db84f97475311feb5dfa7e4637ddbaf4bf9fabb808184ef44ac9f585bc89f6fd
7
- data.tar.gz: 42307b6892bd7946f2be04a1a184003e88c041b150233bb36c0d135045736ea3491679fb7d10a0f14f4a15515ed37ec9aa2cde25041421e3becb5ee69443c44f
6
+ metadata.gz: 3cbb12faf56930279a8c08d5ba282e11471e22ae1f64e4e0e71db6f51390dd19c8d1697bda2084abf996ccd8419fae509e2e7feb8e1612dbade1350c7b21862a
7
+ data.tar.gz: 6b27c9f2330243b736aee06122afd9b28b4a7cc7af793ded4a051fa925b1f2e2024a4a2fd040def10efbee0b705ea8194483d78f34d0d408ab3b0bc344b5149b
@@ -39,11 +39,6 @@ module Memberships::Base
39
39
  scope :current_and_invited, -> { includes(:invitation).where("user_id IS NOT NULL OR invitations.id IS NOT NULL").references(:invitation) }
40
40
  scope :current, -> { where("user_id IS NOT NULL") }
41
41
  scope :tombstones, -> { includes(:invitation).where("user_id IS NULL AND invitations.id IS NULL AND platform_agent IS FALSE").references(:invitation) }
42
-
43
- # TODO Probably we can provide a way for gem packages to define these kinds of extensions.
44
- if billing_enabled?
45
- scope :billable, -> { current_and_invited }
46
- end
47
42
  end
48
43
 
49
44
  def name
@@ -36,14 +36,6 @@ module Records::Base
36
36
  scope :newest_updated, -> { order("updated_at DESC") }
37
37
  scope :oldest_updated, -> { order("updated_at ASC") }
38
38
 
39
- # TODO Probably we can provide a way for gem packages to define these kinds of extensions.
40
- if billing_enabled?
41
- # By default, any model in a collection is considered active for billing purposes.
42
- # This can be overloaded in the child model class to specify more specific criteria for billing.
43
- # See `app/models/concerns/memberships/base.rb` for an example.
44
- scope :billable, -> { order("TRUE") }
45
- end
46
-
47
39
  # Microscope adds useful scopes targeting ActiveRecord `boolean`, `date` and `datetime` attributes.
48
40
  # https://github.com/mirego/microscope
49
41
  acts_as_microscope
@@ -22,17 +22,6 @@ module Teams::Base
22
22
  # integrations
23
23
  has_many :integrations_stripe_installations, class_name: "Integrations::StripeInstallation", dependent: :destroy if stripe_enabled?
24
24
 
25
- # TODO Probably we can provide a way for gem packages to define these kinds of extensions.
26
- if billing_enabled?
27
- # subscriptions
28
- has_many :billing_subscriptions, class_name: "Billing::Subscription", dependent: :destroy, foreign_key: :team_id
29
-
30
- # TODO We need a way for `bullet_train-billing-stripe` to define these.
31
- if defined?(Billing::Stripe::Subscription)
32
- has_many :billing_stripe_subscriptions, class_name: "Billing::Stripe::Subscription", dependent: :destroy, foreign_key: :team_id
33
- end
34
- end
35
-
36
25
  # validations
37
26
  validates :name, presence: true
38
27
  validates :time_zone, inclusion: {in: ActiveSupport::TimeZone.all.map(&:name)}, allow_nil: true
@@ -68,19 +57,5 @@ module Teams::Base
68
57
  self
69
58
  end
70
59
 
71
- # TODO Probably we can provide a way for gem packages to define these kinds of extensions.
72
- if billing_enabled?
73
- def current_billing_subscription
74
- # If by some bug we have two subscriptions, we want to use the one that existed first.
75
- # The reasoning here is that it's more likely to be on some legacy plan that benefits the customer.
76
- billing_subscriptions.active.order(:created_at).first
77
- end
78
-
79
- def needs_billing_subscription?
80
- return false if freemium_enabled?
81
- billing_subscriptions.active.empty?
82
- end
83
- end
84
-
85
60
  ActiveSupport.run_load_hooks :bullet_train_teams_base, self
86
61
  end
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.4.11"
2
+ VERSION = "1.5.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.11
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver