Skip to content

Added ability to search for tickets by event_id - #1

Open
eewang wants to merge 2 commits into
rloomba:masterfrom
eewang:search_tix_by_event_id
Open

Added ability to search for tickets by event_id#1
eewang wants to merge 2 commits into
rloomba:masterfrom
eewang:search_tix_by_event_id

Conversation

@eewang

@eewang eewang commented Mar 6, 2013

Copy link
Copy Markdown

No description provided.

@rloomba

rloomba commented Mar 7, 2013

Copy link
Copy Markdown
Owner

Hi, thanks for the pull request. A couple things:

  • base_uri is a method defined within the gem HTTTParty, please refer to line 91 of here: https://github.com/jnunemaker/httparty/blob/master/lib/httparty.rb. changing to @base_uri is not necessary
  • I believe a better implementation of finding tickets for a given event would be to search for the event by id, this will return an Event object. Then call a "tickets" instance method on this Event object, which should return an array of Ticket objects that belong to that specific Event.

please feel free to rework your pull request accordingly

@rurabe

rurabe commented Apr 29, 2013

Copy link
Copy Markdown

I think eewang is on the right track though, you will want a way to get tickets for an event_id that is known without having to do two separate requests.

The way I approached it in my pull request was by giving every class a ::find method that lets you build a query from scratch. And when you look at the syntax, I think it's pretty clear what's going on when you call:

Ticket.find(:event_id => 12345)

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.

3 participants