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
# in your spec_helper.rb | |
RSpec.configure do |config| | |
config.around(:each) do |example| | |
timeout(0.2) { example.run } | |
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
# session controller | |
# receives callbacks with oauth | |
class SessionsController < ApplicationController | |
skip_before_filter :login_required | |
def create | |
login.run! | |
redirect_to root_path | |
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
class Membership | |
belongs_to :user | |
belongs_to :group | |
after_save :send_email_notification, if: ->(m) { m.accepted_changed? && m.accepted? } | |
def send_email_nofication | |
NotificationMailer.accepted(self, user).deliver! | |
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
class Membership | |
belongs_to :user | |
belongs_to :group | |
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? } | |
def send_notifications | |
NotificationMailer.accepted(self, user).deliver! | |
NotificationMailer.accepted_admin(self, group.admin).deliver! |
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
class Membership | |
belongs_to :user | |
belogns_to :group | |
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? } | |
def send_notifications | |
NotificationMailer.accepted(self, user).deliver! | |
PushNotifcations::NewMembership.new(self, user).dispatch! |
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
class Membership | |
belongs_to :user | |
belogns_to :group | |
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? } | |
def send_notifications | |
NotificationMailer.accepted(self, user).deliver! | |
PushNotifcations::NewMembership.new(self, user).dispatch! |
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
class Membership | |
belongs_to :user | |
belogns_to :group | |
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? } | |
def send_notifications | |
Resque.enqueue MembershipNotificationsWorker, self.id | |
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
class Membership | |
belongs_to :user | |
belogns_to :group | |
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? } | |
def send_notifications | |
Resque.enqeue(NotificationMailerWorker, self.id, user.id) | |
Resque.enqeue(PushNotifcations::NewMembershipWorker, self.id, user.id) |
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
class Membership | |
belongs_to :user | |
belogns_to :group | |
after_save :send_notifications, if: ->(m) { m.accepted_changed? && m.accepted? } | |
def send_notifications | |
Resque.enqeue(NotificationMailerWorker, self.id, user.id) | |
Resque.enqeue(PushNotifcations::NewMembershipWorker, self.id, user.id) |
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
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |