schedulable 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/schedulable/acts_as_schedulable.rb +7 -2
- data/lib/schedulable/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjI3OTAyOWYyMmM3MDUyOGMyNmZkOTEzOWE1MDA1ZmFiMDRhNjdlYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGE5NGM5ZTY3OTljMDYzYjgwYjczMDNlMjA5MDdkNGUyYmVlZWU2Zg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzdhNWUxNmVhZDk0NWY5YTNjMjE5MDA2YTIyYjVjM2NhN2NiZWI0N2Y5MzFj
|
10
|
+
MTkwMDQxYzA5ZTdlMGVjNDJhMGZlYjQyMDE3YzA4ODRhNmQyYmFkMmIzNDk2
|
11
|
+
OGFlYmUxNDUwMzNiMTNkOWI5M2QwNjMzZjFiZGY0ZDE4OWYwNmQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjRkN2RiZTdlYWNlOGY2NzkxMDA5MmIzZmJkNzMzMjRlYzgyNDNiYWIwYWU0
|
14
|
+
NTRmN2YzZGFhYTU5YjI3OGEzNTY4ZjUyMWRlMDQzYzU2NzgyOGIxMjZhZmIz
|
15
|
+
MjkwMTg4NTk2OTYxM2VmM2JkNzhiYTdhNWJmNDgzZjI4OTBkZmE=
|
@@ -34,15 +34,20 @@ module Schedulable
|
|
34
34
|
|
35
35
|
has_many occurrences_association, options[:occurrences]
|
36
36
|
|
37
|
+
# table_name
|
38
|
+
occurrences_table_name = occurrences_association.to_s.tableize
|
39
|
+
|
40
|
+
puts "SCHEDULABLE OCCURRENCES TABLE NAME: " + occurrences_table_name.to_s
|
41
|
+
|
37
42
|
# remaining
|
38
43
|
remaining_occurrences_options = options[:occurrences].clone
|
39
44
|
remaining_occurrences_association = ("remaining_" << occurrences_association.to_s).to_sym
|
40
|
-
has_many remaining_occurrences_association, -> { where "date >= ?", Time.now}, remaining_occurrences_options
|
45
|
+
has_many remaining_occurrences_association, -> { where "#{occurrences_table_name}.date >= ?", Time.now}, remaining_occurrences_options
|
41
46
|
|
42
47
|
# previous
|
43
48
|
previous_occurrences_options = options[:occurrences].clone
|
44
49
|
previous_occurrences_association = ("previous_" << occurrences_association.to_s).to_sym
|
45
|
-
has_many previous_occurrences_association, -> { where "date < ?", Time.now}, previous_occurrences_options
|
50
|
+
has_many previous_occurrences_association, -> { where "#{occurrences_table_name}.date < ?", Time.now}, previous_occurrences_options
|
46
51
|
|
47
52
|
ActsAsSchedulable.add_occurrences_association(self, occurrences_association)
|
48
53
|
|
data/lib/schedulable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schedulable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Nowrotek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|