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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmY2ZDcyZTUzMjFkNGM2MGYxZGM2NzFiMTlhM2RkMTUyZWM1ODg4OQ==
4
+ NjI3OTAyOWYyMmM3MDUyOGMyNmZkOTEzOWE1MDA1ZmFiMDRhNjdlYQ==
5
5
  data.tar.gz: !binary |-
6
- YzcxODQ4ZGY1NjA3OTA1OGUxNDU1MWE0YTEzM2NmOTQ3ZGU5OGY1Yw==
6
+ OGE5NGM5ZTY3OTljMDYzYjgwYjczMDNlMjA5MDdkNGUyYmVlZWU2Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTU2OWRjM2I0NTYyM2FhNmUxNjVmYWUxNDQ4MTg0OWRkODA5NzU3MDQ3NjVh
10
- Yjg2M2NhMjYyNmU1NmZkMDZjNGEwY2I5OGY0NzZkYmU4MmNiODA0YjhjOTNl
11
- MWVkNGY1ZmZjZTJmOGQ4N2VkYTUwMjdhZWI0NmIyMTc1NGQ1YWI=
9
+ NzdhNWUxNmVhZDk0NWY5YTNjMjE5MDA2YTIyYjVjM2NhN2NiZWI0N2Y5MzFj
10
+ MTkwMDQxYzA5ZTdlMGVjNDJhMGZlYjQyMDE3YzA4ODRhNmQyYmFkMmIzNDk2
11
+ OGFlYmUxNDUwMzNiMTNkOWI5M2QwNjMzZjFiZGY0ZDE4OWYwNmQ=
12
12
  data.tar.gz: !binary |-
13
- ODIzOWVlYzY4ZGEyN2FkMWIyZDM2NmVhZTYzYjQ1NjBkM2I0MzQ5NDRhNWI0
14
- ODA4NGFmMzRkY2U4MjEwYWZmMjI0NjcwNWQ0NjY1MmMwMGZkZjE1ZjUxOTFm
15
- Mzc5OTNlNjE5YmQ5ODQwZDQ5NWE5MTIzM2RiMDk0NDU5ODY1ZTc=
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
 
@@ -1,3 +1,3 @@
1
1
  module Schedulable
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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
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-14 00:00:00.000000000 Z
11
+ date: 2014-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails