effective_learndash 0.1.5 → 0.1.6

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: 43df5441a08d0a4f6974c1833c3967e007f0b84d29bb0211a574b9b5803ecf6e
4
- data.tar.gz: '019f88430901977c58b6ae5a2266aa9b27a548689d1d14aa78926ec32639f582'
3
+ metadata.gz: bf3a76614af4d9fba4a5d9e483ecfc78ec821c042643b0d59508b42f80aead20
4
+ data.tar.gz: 3e383233f17438db0bc4c134e8fb767183b3697b0036100ddf89e80961b42332
5
5
  SHA512:
6
- metadata.gz: ebb0420d408114b919048393146dc0fbfb25c66f635672e8da07beef5847f78388e11cc08b243299db4ef132cd220025ba945715b83e87440e957b37f9ed71f2
7
- data.tar.gz: dc6af37f79445a95ebed1e4501be634ec795d5e1f7ca09e997087e25a0aa95cb8d392a892cd51207998d2ea0d2c30ba885fc8865364860fee0d9260d70cdcb32
6
+ metadata.gz: 73041dc5fa8d6e130f865cd0ed5acf4c966ff1d7148168d6482f582f68c29d86fd8521c6d23aeb35227ca1f70810bd54b88408527767c3654b0998f8f6513d37
7
+ data.tar.gz: 58d39dc3138ff44d2be3152aba69734f7f83146714b1b79a44b084cdc05dcd865974e457b4f61c2c3dd2436e5a81b709db7ea3cde5b68b807a325bf28df7c58e
@@ -87,9 +87,9 @@ module EffectiveLearndashCourseRegistration
87
87
  course_registrants
88
88
  end
89
89
 
90
+ # Enroll them in all courses.
90
91
  def after_submit_purchased!
91
- # Enroll them in the course!
92
- learndash_owner.create_learndash_enrollment(course: learndash_course)
92
+ course_registrants.each { |registrant| registrant.owner.create_learndash_enrollment(course: registrant.learndash_course) }
93
93
  end
94
94
 
95
95
  end
@@ -116,7 +116,7 @@ module EffectiveLearndashCourseRegistration
116
116
  end
117
117
 
118
118
  def build_course_registrant
119
- course_registrants.build(owner: owner)
119
+ course_registrants.build(owner: owner, learndash_course: learndash_course)
120
120
  end
121
121
 
122
122
  def learndash_owner
@@ -151,7 +151,7 @@ module EffectiveLearndashCourseRegistration
151
151
 
152
152
  # Assign prices
153
153
  assign_pricing()
154
- raise('expected course_registrant to have a price') if course_registrant.price.blank?
154
+ raise('expected course_registrants to have a price') if course_registrants.any? { |registrant| registrant.price.blank? }
155
155
 
156
156
  # Save record
157
157
  save!
@@ -1,3 +1,3 @@
1
1
  module EffectiveLearndash
2
- VERSION = '0.1.5'.freeze
2
+ VERSION = '0.1.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_learndash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-31 00:00:00.000000000 Z
11
+ date: 2022-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails