move subscribe to its own controller, add authorization, test subscribe/unsubscribe
This commit is contained in:
parent
97bf86454e
commit
3be200abcc
7 changed files with 92 additions and 43 deletions
|
|
@ -55,6 +55,10 @@ class User < ActiveRecord::Base
|
|||
},
|
||||
presence: true
|
||||
|
||||
def subscribed? conference
|
||||
self.subscriptions.find_by(conference_id: conference.id).present?
|
||||
end
|
||||
|
||||
# Returns the ticket purchased ticket
|
||||
# ====Returns
|
||||
# * +TicketUser::ActiveRecord_Relation+ -> user
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue