forked from railsbridge/bridge_troll
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Users can associate with their Meetup account on the Account page.
This does an OAuth request with Meetup to determine the user's meetup ID. RSVPs from past Meetup events will show up on the user's Profile page.
- Loading branch information
1 parent
22931ac
commit d457c79
Showing
18 changed files
with
267 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: rails server thin -p $PORT -e $RACK_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class OmniauthsController < ApplicationController | ||
before_filter :authenticate_user! | ||
|
||
def callback | ||
auth_hash = request.env['omniauth.auth'] | ||
MeetupImporter.new.associate_user(current_user, auth_hash['uid']) | ||
redirect_to edit_user_registration_path | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<table class="datatable table table-striped table-bordered table-condensed"> | ||
<thead> | ||
<tr> | ||
<th>Title</th> | ||
<th>Date</th> | ||
<th>Location</th> | ||
<th>Role</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% rsvps.each do |rsvp| %> | ||
<% event = rsvp.event %> | ||
<tr> | ||
<td> | ||
<%= link_to event.title, event %> | ||
<% if event.meetup_student_event_id %> | ||
<%= link_to "[Student Meetup]", "http://www.sfruby.info/events/#{event.meetup_student_event_id}/", class: 'meetup-link' %> | ||
<% end %> | ||
<% if event.meetup_volunteer_event_id %> | ||
<%= link_to "[Volunteer Meetup]", "http://www.sfruby.info/events/#{event.meetup_volunteer_event_id}/", class: 'meetup-link' %> | ||
<% end %> | ||
</td> | ||
<td><%= formatted_session_date(event.event_sessions.first) %></td> | ||
<td><%= event.location.name rescue nil %></td> | ||
<td><%= rsvp.role.title %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Rails.application.config.middleware.use OmniAuth::Builder do | ||
provider :meetup, ENV['MEETUP_OAUTH_KEY'], ENV['MEETUP_OAUTH_SECRET'] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddMeetupIdToUsers < ActiveRecord::Migration | ||
def change | ||
add_column :users, :meetup_id, :integer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require 'spec_helper' | ||
require Rails.root.join('spec', 'services', 'meetup_request_fixtures') | ||
|
||
describe OmniauthsController do | ||
context "after meetup hits the callback" do | ||
before do | ||
@user = create(:user) | ||
sign_in @user | ||
|
||
OmniAuth.config.test_mode = true | ||
authed_params = MeetupRequestFixtures.oauth_response(7654321) | ||
OmniAuth.config.mock_auth[:meetup] = OmniAuth::AuthHash.new(authed_params) | ||
request.env["omniauth.auth"] = OmniAuth.config.mock_auth[:meetup] | ||
end | ||
|
||
it 'informs the meetup importer that this bridgetroll user has claimed this meetup user' do | ||
MeetupImporter.any_instance.should_receive(:associate_user).with(@user, 7654321) | ||
|
||
get :callback, provider: :meetup | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.