From a1a24751e38fa18b59c6064360c1411a74e56e73 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 19 Aug 2015 13:28:50 +0800 Subject: [PATCH] update for tickets dependency --- app/controllers/admin/register_api_controller.rb | 3 ++- app/models/registered_site.rb | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/register_api_controller.rb b/app/controllers/admin/register_api_controller.rb index c7f8139..2163b1d 100644 --- a/app/controllers/admin/register_api_controller.rb +++ b/app/controllers/admin/register_api_controller.rb @@ -57,7 +57,7 @@ class Admin::RegisterApiController < ApplicationController response["message"] = "Site not confirmed, please confirm the email, sent to #{site.admin_email} to proceed." response["error"] = "SITE_NOT_CONFIRMED" elsif !site.access_granted - response["message"] = "Store permissions reovked." + response["message"] = "Store permissions revoked." response["error"] = "SITE_PERMISSION_DENIED" else response["success"] = true @@ -72,6 +72,7 @@ class Admin::RegisterApiController < ApplicationController request = Net::HTTP::Post.new("/store/confirmation") request.body = params_to_send.to_query response = http.request(request) + return response end def confirm_email diff --git a/app/models/registered_site.rb b/app/models/registered_site.rb index a288a35..c90f3d4 100644 --- a/app/models/registered_site.rb +++ b/app/models/registered_site.rb @@ -15,6 +15,7 @@ class RegisteredSite has_many :site_logs has_many :installed_modules + has_many :tickets index({ confirmation_token: 1}, { unique: true }) scope :active, ->{where(:access_granted => true,:site_confirmed => true)}