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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6eb2371d420ae282aecca6fe59883224b3102dd09d202f56be75180765b65ff3
4
- data.tar.gz: 9e95e8974c3756bc92b844c8545e8ab10b68dd3e2bc7e8c08755b28c99db886f
3
+ metadata.gz: 87e52e6957936bdcd5edc9debdad8e631d22e37d3077506eca3ca26c8d5eba1a
4
+ data.tar.gz: cf4eb36b9850f5e6e9534dbe09aae83872029d0ff08d8ee1d94ff14eab486b1d
5
5
  SHA512:
6
- metadata.gz: a3b8229756fc75a69b03f0934a4eb7f8da253fc17cf37b6cf19d126d1999f3e145f2a10a74d3db4eb16f5752d8b324c18a9031827fb273b3249f0dc146236945
7
- data.tar.gz: 101dd24f148d4356471482ac13ec54dab698e2690c368a10bf98e0672a6c3899623f2eff7ea6a5d026143c17f62d5ad5aea667eb94284c40bdf43c2aabf00769
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
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveLearndash
2
- VERSION = '0.5.0'.freeze
2
+ VERSION = '0.5.1'.freeze
3
3
  end
@@ -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?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_learndash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect