OSDN Git Service

Merge branch 'v05' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v05
[pettanr/pettanr.git] / app / controllers / provider_statuses_controller.rb
index ab5c043..2892cf8 100644 (file)
@@ -69,37 +69,37 @@ class ProviderStatusesController < ApplicationController
   def licenses_import
     @provider_status = ProviderStatus.show(params[:id], @admin)
     raise ActiveRecord::Forbidden if @provider_status.status == 0
-    @failures = @provider_status.licenses_import params[:date]
+    @import_result = @provider_status.licenses_import params[:date]
     respond_to do |format|
       format.html # show.html.erb
-      format.json { render :json => @failures.to_json() }
+      format.json { render :json => @import_result.to_json() }
     end
   end
   
   def artists_import
     @provider_status = ProviderStatus.show(params[:id], @admin)
     raise ActiveRecord::Forbidden if @provider_status.status == 0
-    @failures = @provider_status.artists_import params[:date]
+    @import_result = @provider_status.artists_import params[:date]
     respond_to do |format|
       format.html # show.html.erb
-      format.json { render :json => @failures.to_json() }
+      format.json { render :json => @import_result.to_json() }
     end
   end
   
   def original_pictures_import
     @provider_status = ProviderStatus.show(params[:id], @admin)
     raise ActiveRecord::Forbidden if @provider_status.status == 0
-    @failures = @provider_status.original_pictures_import params[:date]
+    @import_result = @provider_status.original_pictures_import params[:date]
     respond_to do |format|
       format.html # show.html.erb
-      format.json { render :json => @failures.to_json() }
+      format.json { render :json => @import_result.to_json() }
     end
   end
   
   def import
     @provider_status = ProviderStatus.show(params[:id], @admin)
     raise ActiveRecord::Forbidden if @provider_status.status == 0
-    @failures = port
+    @import_result = @provider_status.import params[:date]
     respond_to do |format|
       format.html # show.html.erb
       format.json { render :json => @failures.to_json() }
@@ -107,10 +107,8 @@ class ProviderStatusesController < ApplicationController
   end
   
   def import_all
-    ProviderStatus.find(:all).each do |provider_status|
-      next unless provider_status.status == 3
-      @provider_status = provider_status
-      @failures = port
+    ProviderStatus.approve_list.each do |provider_status|
+      @provider_status = provider_status params[:date]
     end
     respond_to do |format|
       format.html { render :text => 'ok'}