Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix event fetch query #9

Closed
wants to merge 2 commits into from
Closed

Conversation

aditya-kapoor
Copy link
Contributor

  • Fix the query criteria for the fetching of event in the given time slot.
  • Rename get_events action to index to make it more in line with RESTful ideology

Fixes #8

def index
start_time = Time.at(params['start'].to_i).to_formatted_s(:db)
end_time = Time.at(params['end'].to_i).to_formatted_s(:db)
@events = Event.where('starttime >= ? or endtime <= ?', start_time, end_time)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets not use OR in this query. Lets try to find those events which lies in given interval start_time and end_time.
Else it would return very large data set

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then the issue #9 is valid...

@aditya-kapoor
Copy link
Contributor Author

Closing in favor of #10

@aditya-kapoor aditya-kapoor deleted the fix-event-fetch-query branch June 25, 2014 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Long events
2 participants