qalam_merit 4.5.05 → 4.5.06
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/merit/class_methods.rb +1 -1
- data/lib/merit/models/active_record/badges_sash.rb +1 -0
- data/lib/merit/models/sash_concern.rb +15 -4
- data/qalam_merit.gemspec +1 -1
- 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: d32a4d56924a23f24741b8aa276cd54f32767ad51d8c04df8d138f4c82d2c427
|
|
4
|
+
data.tar.gz: 5202cdc4c9c90323f07dffe90eb1db4a6690df92dce156fb7466f30526482bf5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a64775d9aa10271625631b8bbad64482a3fc09c1776652a7fba52bdafb3a78da0a87ea5c1a7b3fd6d8f4c20dace827087c2c4790578fcd4eeb1d2634608e031
|
|
7
|
+
data.tar.gz: 73a2d727db358c669dccdf8e9f73212410c563ce50262e20052ab6b8cd73111f932cfb09aa1ae8fdc00edeaa68018278d0a99baaf9421d62492b5a8fa26679f4
|
data/lib/merit/class_methods.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Merit
|
|
|
16
16
|
|
|
17
17
|
# Delegate methods from meritable models to their sash
|
|
18
18
|
def _merit_delegate_methods_to_sash
|
|
19
|
-
methods = %w(badge_ids badges points add_badge rm_badge
|
|
19
|
+
methods = %w(badge_ids badges points add_badge add_qalam_badge rm_badge
|
|
20
20
|
add_points subtract_points score_points)
|
|
21
21
|
methods.each { |method| delegate method, to: :_sash }
|
|
22
22
|
end
|
|
@@ -8,16 +8,27 @@ module Merit::Models
|
|
|
8
8
|
badges_sashes.map(&:badge_id)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def add_badge(badge_id)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
def add_badge(badge_id, options = {})
|
|
12
|
+
if (course_id = options[:course_id])
|
|
13
|
+
bs = Merit::BadgesSash.new(badge_id: badge_id.to_i, course_id: course_id.to_i)
|
|
14
|
+
else
|
|
15
|
+
bs = Merit::BadgesSash.new(badge_id: badge_id.to_i)
|
|
16
|
+
end
|
|
17
|
+
badges_sashes << bs
|
|
18
|
+
bs
|
|
15
19
|
end
|
|
16
20
|
|
|
17
21
|
def rm_badge(badge_id)
|
|
18
22
|
badges_sashes.where(badge_id: badge_id.to_i).first.try(:destroy)
|
|
19
23
|
end
|
|
20
24
|
|
|
25
|
+
########################QALAM_DEV#########################
|
|
26
|
+
def add_qalam_badge(badge_id, course_id)
|
|
27
|
+
bs = Merit::BadgesSash.new(badge_id: badge_id.to_i, course_id: course_id.to_i)
|
|
28
|
+
badges_sashes << bs
|
|
29
|
+
bs
|
|
30
|
+
end
|
|
31
|
+
########################END###################################
|
|
21
32
|
# Retrieve the number of points from a category
|
|
22
33
|
# By default all points are summed up
|
|
23
34
|
# @param category [String] The category
|
data/qalam_merit.gemspec
CHANGED
|
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
|
|
|
6
6
|
s.files = `git ls-files`.split("\n").reject{|f| f =~ /^\./ }
|
|
7
7
|
s.test_files = `git ls-files -- test/*`.split("\n")
|
|
8
8
|
s.license = 'MIT'
|
|
9
|
-
s.version = '4.5.
|
|
9
|
+
s.version = '4.5.06'
|
|
10
10
|
s.authors = ["Tute Costa", "Ahmed Abdelhamid"]
|
|
11
11
|
s.email = ['tutecosta@gmail.com', 'a.hamid@nezam.io']
|
|
12
12
|
|