site store confirmation enabled

This commit is contained in:
Harry Bomrah 2014-02-27 17:34:49 +08:00
parent 1afcd7b289
commit d853cb9f63
3 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,13 @@
class StoreConfirmationController < ApplicationController
def confirm
if params[:site_token]
site = Site.first
site.confirm_store(params[:site_token])
render :json => {"success" => "true"}
else
render :json => {"success" => "false"}
end
end
end

View File

@ -56,6 +56,13 @@ class Site
index({ access_token: 1}, { unique: true }) index({ access_token: 1}, { unique: true })
def confirm_store(site_token)
if self.site_token.eql?(site_token)
self.store_confirmation = true
self.save
end
end
def minimum_enabled_locales def minimum_enabled_locales
size = self.in_use_locales.length size = self.in_use_locales.length
if size < 1 if size < 1

View File

@ -359,6 +359,8 @@ Orbit::Application.routes.draw do
match "/facebook/profile_import" => "facebook#profile_import" match "/facebook/profile_import" => "facebook#profile_import"
match "/desktop/wallpaper_upload" => "desktop#wallpaper_upload" match "/desktop/wallpaper_upload" => "desktop#wallpaper_upload"
match "/store_confirmation/confirm" => "store_confirmation#confirm"
#match '/desktop_orbit/eventajaxload' => 'desktop_publications#create_journal' #match '/desktop_orbit/eventajaxload' => 'desktop_publications#create_journal'
#match '/desktop_orbit/eventajaxload' => 'desktop_publications#delete_journal' #match '/desktop_orbit/eventajaxload' => 'desktop_publications#delete_journal'
# match '/desktop_orbit/eventajaxload' => 'desktop_publications#update_journal' # match '/desktop_orbit/eventajaxload' => 'desktop_publications#update_journal'