lib/turntabler/room.rb
def attributes=(attrs)
      if attrs
        super('users' => attrs.delete('users')) if attrs['users']
        super
        
        # Set room-level attributes that are specific to the song
        song_attributes = attrs['metadata'] && attrs['metadata'].select {|key, value| %w(upvotes downvotes votelog).include?(key)}
        current_song.attributes = song_attributes if @current_song
      end
    end
def attributes=(attrs)
      if attrs
        super('users' => attrs.delete('users')) if attrs['users']
        super
        
        # Set room-level attributes that are specific to the song
        song_attributes = attrs['metadata'] && attrs['metadata'].select {|key, value| %w(upvotes downvotes votelog).include?(key)}
        current_song.attributes = song_attributes if @current_song
      end
    end
def attributes = ( attrs ) if attrs super ( 'users' => attrs . delete ( 'users' ) ) if attrs [ 'users' ] super # Set room-level attributes that are specific to the song song_attributes = attrs [ 'metadata' ] && attrs [ 'metadata' ] . select { | key , value | %w( upvotes downvotes votelog ) . include? ( key ) } current_song . attributes = song_attributes if @current_song end end
Sets the current attributes for this room, ensuring that the full list of
 listeners gets set first so that we can use those built users to then fill
 out the collection of djs, moderators, etc.

 @api private
 @param [Hash] attrs The attributes to set
Sets the current attributes for this room ensuring that the full list of listeners gets set first so that we can use those built users to then fill out the collection of djs moderators etc .