From 167f1ea6aed72a78b7c2253b69365b3cfc528d34 Mon Sep 17 00:00:00 2001 From: Lee Lawlor Date: Fri, 13 Feb 2015 08:57:23 -0500 Subject: [PATCH] fix channel params --- app/controllers/channels_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/channels_controller.rb b/app/controllers/channels_controller.rb index c1f02b3..ba7e039 100644 --- a/app/controllers/channels_controller.rb +++ b/app/controllers/channels_controller.rb @@ -195,6 +195,10 @@ class ChannelsController < ApplicationController # get the current user or find the user via their api key @user = current_user || User.find_by_api_key(get_apikey) @channel = @user.channels.find(params[:id]) + + # make updating attributes easier for updates via api + params[:channel] = params if params[:channel].blank? + @channel.assign_attributes(channel_params) if !@channel.valid? @@ -596,3 +600,4 @@ class ChannelsController < ApplicationController end end +