fix channel video_id validation when updating
This commit is contained in:
@ -202,7 +202,8 @@ class ChannelsController < ApplicationController
|
||||
@channel.assign_attributes(channel_params)
|
||||
|
||||
if !@channel.valid?
|
||||
flash[:alert] = @channel.errors.full_messages.join(', ')
|
||||
@channel.errors.add(:base, t(:channel_video_type_blank))
|
||||
flash[:alert] = @channel.errors.full_messages.join('. ')
|
||||
redirect_to channel_path(@channel.id, :anchor => "channelsettings") and return
|
||||
end
|
||||
|
||||
|
@ -76,7 +76,7 @@ class Channel < ActiveRecord::Base
|
||||
|
||||
before_destroy :delete_feeds
|
||||
|
||||
validates :video_type, :presence => { :message => I18n.t(:channel_video_type_blank) }, :if => lambda{ |channel| channel.video_id.present? }
|
||||
validates :video_type, :presence => true, :if => lambda{ |channel| channel.video_id.present? }
|
||||
|
||||
scope :public_viewable, lambda { where("public_flag = true AND social != true") }
|
||||
scope :not_social, lambda { where("social != true") }
|
||||
|
Reference in New Issue
Block a user