active_recall 1.6.3 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -7
- data/lib/active_recall/models/deck.rb +10 -11
- data/lib/active_recall/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90faada77c84371101ce19140d8c0e113fa06a831ed0c11613ac46bc7221a798
|
4
|
+
data.tar.gz: 6aaaf972df81c2341143307c4998bcb7c0b0017e1e0979bc54b8bddaf5a74d86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a4cf31bf1d9860b954aaaf482dfc4ac990012b6ea65432135f267d324505ddad9f856deca45318c3671b69b339c1a53bc8b6c10bb99ce3bad54db6f5b4736ea
|
7
|
+
data.tar.gz: 87cb8640cf8f2ed2bdcdda45c36064f943c303d001155676160f357b1190d64b6451ac3d68091d92f7db6cc7c64b6cb4c73a10781c390ea0edfb89185e69ad4f
|
data/Gemfile.lock
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
active_recall (1.6.
|
4
|
+
active_recall (1.6.4)
|
5
5
|
activerecord (>= 5.2.3, <= 6.2)
|
6
6
|
activesupport (>= 5.2.3, <= 6.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (6.1.4)
|
12
|
-
activesupport (= 6.1.4)
|
13
|
-
activerecord (6.1.4)
|
14
|
-
activemodel (= 6.1.4)
|
15
|
-
activesupport (= 6.1.4)
|
16
|
-
activesupport (6.1.4)
|
11
|
+
activemodel (6.1.4.1)
|
12
|
+
activesupport (= 6.1.4.1)
|
13
|
+
activerecord (6.1.4.1)
|
14
|
+
activemodel (= 6.1.4.1)
|
15
|
+
activesupport (= 6.1.4.1)
|
16
|
+
activesupport (6.1.4.1)
|
17
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
18
|
i18n (>= 1.6, < 2)
|
19
19
|
minitest (>= 5.1)
|
@@ -42,21 +42,12 @@ module ActiveRecall
|
|
42
42
|
.destroy
|
43
43
|
end
|
44
44
|
|
45
|
-
# OPTIMIZE: Attempt in active record, rather than array of Ruby records
|
46
45
|
def review
|
47
|
-
|
48
|
-
words += items.send(s).order(random_order_function).map(&:source)
|
49
|
-
end
|
46
|
+
_review.map(&:source)
|
50
47
|
end
|
51
48
|
|
52
|
-
# OPTIMIZE: Use optimized #review and build only the record to be returned
|
53
49
|
def next
|
54
|
-
|
55
|
-
%i[untested failed expired].each do |category|
|
56
|
-
word = items.send(category).order(random_order_function).limit(1).map(&:source).first
|
57
|
-
break if word
|
58
|
-
end
|
59
|
-
word
|
50
|
+
_review.first.try(:source)
|
60
51
|
end
|
61
52
|
|
62
53
|
def last
|
@@ -89,6 +80,14 @@ module ActiveRecall
|
|
89
80
|
|
90
81
|
private
|
91
82
|
|
83
|
+
def _review
|
84
|
+
items
|
85
|
+
.untested
|
86
|
+
.or(items.failed)
|
87
|
+
.or(items.expired)
|
88
|
+
.order(random_order_function)
|
89
|
+
end
|
90
|
+
|
92
91
|
def random_order_function
|
93
92
|
Arel.sql(mysql? ? 'RAND()' : 'random()')
|
94
93
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_recall
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Gravina
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-09-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|