effective_learndash 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/learndash_enrollment.rb +2 -0
- data/app/models/effective/learndash_user.rb +2 -0
- data/app/views/admin/learndash_users/_learndash_user.html.haml +1 -1
- data/app/views/effective/learndash/_dashboard.html.haml +1 -1
- data/lib/effective_learndash/version.rb +1 -1
- data/lib/effective_learndash.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87e52e6957936bdcd5edc9debdad8e631d22e37d3077506eca3ca26c8d5eba1a
|
4
|
+
data.tar.gz: cf4eb36b9850f5e6e9534dbe09aae83872029d0ff08d8ee1d94ff14eab486b1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34d1b92f818ef50b710af71865c50ef0e5fbd0ded41a6f65f0eaaf8cc3eb344b580bae3b477b8b9d131a781b81a4e0b03577869fc55f49b2818e064770a456f8
|
7
|
+
data.tar.gz: ef13112da1f237ff71fb734cdc10e42061464706d85bf4a01a7dc4fa24a4fc7ccb340d05d08a5e9bd8722fb0bc4fd773d6a74fbdf39dbc873e58b912142bfac6
|
@@ -104,6 +104,8 @@ module Effective
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def assign_api_attributes(data = nil)
|
107
|
+
return if EffectiveLearndash.disabled?
|
108
|
+
|
107
109
|
data ||= EffectiveLearndash.api.find_enrollment(self) || EffectiveLearndash.api.create_enrollment(self)
|
108
110
|
|
109
111
|
assign_attributes(
|
@@ -83,6 +83,8 @@ module Effective
|
|
83
83
|
|
84
84
|
# This synchronizes all the course enrollments from the API down locally.
|
85
85
|
def assign_api_course_enrollments
|
86
|
+
return if EffectiveLearndash.disabled?
|
87
|
+
|
86
88
|
raise('must be persisted') unless persisted?
|
87
89
|
|
88
90
|
courses = LearndashCourse.all()
|
@@ -3,7 +3,7 @@
|
|
3
3
|
= link_to(learndash_user.owner, "/admin/users/#{learndash_user.owner.to_param}/edit")
|
4
4
|
has an existing account on LearnDash.
|
5
5
|
|
6
|
-
%p= link_to "LearnDash LMS User Admin", EffectiveLearndash.learndash_url.chomp('/') + "/wp-admin/user-edit.php?user_id=#{learndash_user.user_id}", target: '_blank'
|
6
|
+
%p= link_to "LearnDash LMS User Admin", EffectiveLearndash.learndash_url.to_s.chomp('/') + "/wp-admin/user-edit.php?user_id=#{learndash_user.user_id}", target: '_blank'
|
7
7
|
|
8
8
|
%ul
|
9
9
|
%li Email: #{learndash_user.email}
|
@@ -8,7 +8,7 @@
|
|
8
8
|
%p You do not have an account to access courses. When you are enrolled in a course, your account credentials will be displayed here.
|
9
9
|
|
10
10
|
- if learndash_user.present? && authorized_user
|
11
|
-
- learndash_user.refresh!
|
11
|
+
- learndash_user.refresh! unless EffectiveLearndash.disabled?
|
12
12
|
|
13
13
|
%p Your course account credentials are:
|
14
14
|
|
data/lib/effective_learndash.rb
CHANGED
@@ -18,7 +18,13 @@ module EffectiveLearndash
|
|
18
18
|
|
19
19
|
include EffectiveGem
|
20
20
|
|
21
|
+
def self.disabled?
|
22
|
+
learndash_url.blank?
|
23
|
+
end
|
24
|
+
|
21
25
|
def self.api
|
26
|
+
return if disabled?
|
27
|
+
|
22
28
|
raise('please set learndash_url in config/initializers/effective_learndash.rb') unless learndash_url.present?
|
23
29
|
raise('please set learndash_username in config/initializers/effective_learndash.rb') unless learndash_username.present?
|
24
30
|
raise('please set learndash_password in config/initializers/effective_learndash.rb') unless learndash_password.present?
|