OSDN Git Service

t#30328:create op import ...and pull
[pettanr/pettanr.git] / app / controllers / application_controller.rb
index 5bbc56b..3535232 100644 (file)
@@ -7,9 +7,11 @@ class ApplicationController < ActionController::Base
     if devise_controller?
       case resource_name
       when :admin
-        'test'
+        'guest'
       when :user
-        'test'
+        'guest'
+      when :demand_user
+        'guest'
       end
     else
       'application'
@@ -65,7 +67,7 @@ class ApplicationController < ActionController::Base
   end
   
   def authenticate_artist
-    if @author.artist?
+    if @author and @author.artist?
       true
     else
       respond_to do |format|
@@ -110,6 +112,12 @@ class ApplicationController < ActionController::Base
     JSON.parse json
   end
   
+  def export_by action, provider_status, ymd
+    t = ymd_to_time ymd
+    url = export_url provider_status.provider.demander_url, action, provider_status.token, t
+    export_from_provider(url)
+  end
+  
 =begin
   rescue_from ActiveRecord::RecordNotFound, :with => :render_404