effective_learndash 0.3.2 → 0.3.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d25f8c1921377617abd4004f3adbb82d9e38589462c259a37e547ab2ec27798
|
4
|
+
data.tar.gz: 90e18a4a91c097e933bc8488a2f93df434c804f4f66ad8d5520f9861bf80053f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2a6e4788833e47dba46b14a0055f54f7d183261e81f6e74672cd408406109f691a2b80f9f25f4576f05d9adc437ea3af50abd583d501b3092a429a52cad23da
|
7
|
+
data.tar.gz: e6fce4b599ff82a65b53859a95668462a97b7ba6509e81b00268d735802163c0cd271bc85fc9ae0c276425e1ab4a98ab07f3724cee4fe2f7162c42de4b648a1b
|
@@ -23,6 +23,19 @@ module EffectiveLearndashOwner
|
|
23
23
|
# Not used
|
24
24
|
has_many :learndash_enrollments, class_name: 'Effective::LearndashEnrollment', as: :owner, inverse_of: :owner, dependent: :delete_all
|
25
25
|
accepts_nested_attributes_for :learndash_enrollments, allow_destroy: true
|
26
|
+
|
27
|
+
scope :with_completed_learndash_course, -> (course) {
|
28
|
+
courses = Array(course)
|
29
|
+
raise('expected a Learndash Course') unless courses.all? { |course| course.kind_of?(Effective::LearndashCourse) }
|
30
|
+
|
31
|
+
owners = Effective::LearndashEnrollment.completed
|
32
|
+
.where(learndash_course: courses)
|
33
|
+
.where(owner_type: name)
|
34
|
+
.select(:owner_id)
|
35
|
+
|
36
|
+
where(id: owners)
|
37
|
+
}
|
38
|
+
|
26
39
|
end
|
27
40
|
|
28
41
|
# Find
|
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.3.
|
4
|
+
version: 0.3.3
|
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: 2023-
|
11
|
+
date: 2023-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|