summaryrefslogtreecommitdiff
path: root/app/models/solidus_subscriptions/line_item.rb
diff options
context:
space:
mode:
authorAlessandro Desantis <desa.alessandro@gmail.com>2020-09-27 11:01:11 +0200
committerAlessandro Desantis <desa.alessandro@gmail.com>2020-09-27 14:41:30 +0200
commit67abf8e6bda0b29eaa891c4f0e09c7ea811ce668 (patch)
tree898665399d8481609d5047c02e86bec9dc0ad69f /app/models/solidus_subscriptions/line_item.rb
parente30a0fb2dea090f4e30b07c9fcfd5c10d8c86164 (diff)
Implement a `LineItem#subscribable` association
Diffstat (limited to 'app/models/solidus_subscriptions/line_item.rb')
-rw-r--r--app/models/solidus_subscriptions/line_item.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/solidus_subscriptions/line_item.rb b/app/models/solidus_subscriptions/line_item.rb
index 46b0a0e..0acdc02 100644
--- a/app/models/solidus_subscriptions/line_item.rb
+++ b/app/models/solidus_subscriptions/line_item.rb
@@ -33,6 +33,7 @@ module SolidusSubscriptions
inverse_of: :line_items,
optional: true
)
+ belongs_to :subscribable, class_name: "::#{SolidusSubscriptions.configuration.subscribable_class}"
validates :subscribable_id, presence: true
validates :quantity, numericality: { greater_than: 0 }