Skip to content

Instantly share code, notes, and snippets.

Applying: add party has many users
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
"roles": {
"carry_hard": false,
"carry_semi": false,
"jungle_farm": false,
"jungle_gank": false,
"mid_farm": false,
"mid_gank": false,
"offlane_farm": false,
"offlane_gank": false,
"support_hard": false,
module UserPartyActions
extend ActiveSupport::Concern
module ClassMethods
def lol
'lol'
end
end
#controller
def create
@party = Party.new(party_params)
@party.captain_id = @user.id
if @party.save
@user.join_party(@party)
respond_to do |format|
format.html { redirect_to @party, notice: 'Party was successfully created.' }
Dotabay.PartyNewRoute = Ember.Route.extend(
model: ->
@modelFor('party')
)
controller
Dotabay.PartiesNewController = Ember.ObjectController.extend(
actions:
def render_error(options={})
errors = options[:error] || ''
message = options[:message] || ''
action = options[:action] || ''
render json: {errors:{ errors: errors, message: message, action: action}}, status: 422
end
def render_success(options={})
action = options[:action] || ''
render json: {action: action}
roles = {
spectator: [:send_message],
memeber: [:send_message, :change_slot],
captain: [:send_message, :change_slot, :start_game]
}
def send_message(options={})
message = options[:message]
party = options[:party]

##Dotabay Recruitment##

Dotabay is looking for more members (programmers and designers) to expand it's team.

We are currently 2 programmers

###What Dotabay tries to accomplish:###

  • social network for dota2 (something like fb, but with dota only)
  • preselected role mmr (individual rating for each role)
class Party < ActiveRecord::Base
has_one :captain_membership, :foreign_key => 'party_id', :class_name => "Party::Membership::Captain"
has_many :basic_memberships, :foreign_key => 'party_id', :class_name => "Party::Membership::Basic"
has_many :memberships, :foreign_key => 'party_id', :class_name => "Party::Membership"
end
User
User::Achievements
User::Statistics
User::Statistics::Dota2
User::SteamProfile
User::Connection
User::Friendship
User::Chat
Clan