app/controllers/caboose_rets/media_controller.rb in caboose-rets-0.0.28 vs app/controllers/caboose_rets/media_controller.rb in caboose-rets-0.0.29

- old
+ new

@@ -34,11 +34,11 @@ # POST /admin/properties/:mls_acct/photos def admin_add_photo return if !user_is_allowed('media', 'edit') - x = Media.maximum(:media_order, :conditions => {:mls_acct => params[:mls_acct]}) + x = Media.maximum(:media_order, :conditions => {:mls_acct => params[:mls_acct], :media_type => 'Photo'}) x = 0 if x.nil? m = Media.new m.id = Media.maximum(:id) + 1 m.mls_acct = params[:mls_acct] @@ -53,10 +53,10 @@ # POST /admin/properties/:msl_acct/files def admin_add_file return if !user_is_allowed('media', 'edit') - x = Media.maximum(:media_order, :conditions => {:mls_acct => params[:mls_acct]}) + x = Media.maximum(:media_order, :conditions => {:mls_acct => params[:mls_acct], :media_type => 'File'}) x = 0 if x.nil? m = Media.new m.id = Media.maximum(:id) + 1 m.mls_acct = params[:mls_acct]