cycle method added to auto cycle through tweets and exception handling is modified to capture all errors that raise from twitter

This commit is contained in:
AnithaPal 2016-07-27 17:02:40 -04:00
parent f29a15b8e4
commit 881518f1f3
10 changed files with 73 additions and 56 deletions

View file

@ -41,8 +41,6 @@ class Event < ActiveRecord::Base
scope :canceled, -> { where(state: 'canceled') }
scope :withdrawn, -> { where(state: 'withdrawn') }
scope :highlighted, -> { where(is_highlight: true) }
state_machine initial: :new do
state :new
@ -250,10 +248,10 @@ class Event < ActiveRecord::Base
end
##
#Compares event start_time, end_with with current time to predict current events
# Compares event start_time, end_with with current time to predict current events
#
def is_current?
Time.current >= self.start_time && Time.current <= end_time
def current?
Time.current >= self.start_time && Time.current <= self.end_time
end
private
@ -305,10 +303,10 @@ class Event < ActiveRecord::Base
end
##
#Compares event start_time, end_with with current time to predict current events
# Compares event start_time, end_with with current time to predict current events
#
def is_current?
Time.current >= self.start_time && Time.current <= end_time
def current?
Time.current >= self.start_time && Time.current <= self.end_time
end
end