effective_learndash 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/app/models/concerns/effective_learndash_owner.rb +13 -0
- data/db/migrate/{01_create_effective_learndash.rb.erb → 101_create_effective_learndash.rb} +1 -1
- data/lib/effective_learndash/version.rb +1 -1
- data/lib/generators/effective_learndash/install_generator.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6ad48916b87f1ca03d045781ddacfc02686179ebe59d61c952f71bcfd453b2b
|
4
|
+
data.tar.gz: 844ec61521d4b99f35d0e4f98318ea4e78890d386883cd26521eaefb856a28f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14bea235c4f8b191060272b153faa4a82a697b69c27d6b692c788cd9f7dcfc9a36da9f428b06bf732f7ce041048eb4d35006e525054f4b3f36063f4c7c2a6c0b
|
7
|
+
data.tar.gz: 559a17a64a6418df74835211a26b03f7634d21820b096bfe95c82681ca307778b576ddf76e59084f15006495eeea070fdd165f9831d7a57df4fae218f79fc97f
|
data/MIT-LICENSE
CHANGED
@@ -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
|
@@ -20,7 +20,7 @@ module EffectiveLearndash
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def create_migration_file
|
23
|
-
migration_template ('../' * 3) + 'db/migrate/
|
23
|
+
migration_template ('../' * 3) + 'db/migrate/101_create_effective_learndash.rb', 'db/migrate/create_effective_learndash.rb'
|
24
24
|
end
|
25
25
|
|
26
26
|
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.
|
4
|
+
version: 0.4.0
|
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-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -229,7 +229,7 @@ files:
|
|
229
229
|
- app/views/effective/learndash_courses/show.html.haml
|
230
230
|
- config/effective_learndash.rb
|
231
231
|
- config/routes.rb
|
232
|
-
- db/migrate/
|
232
|
+
- db/migrate/101_create_effective_learndash.rb
|
233
233
|
- db/seeds.rb
|
234
234
|
- lib/effective_learndash.rb
|
235
235
|
- lib/effective_learndash/engine.rb
|
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
256
|
- !ruby/object:Gem::Version
|
257
257
|
version: '0'
|
258
258
|
requirements: []
|
259
|
-
rubygems_version: 3.
|
259
|
+
rubygems_version: 3.3.7
|
260
260
|
signing_key:
|
261
261
|
specification_version: 4
|
262
262
|
summary: Create Wordpress users and read LearnDash course progress
|