【发布时间】:2018-11-22 14:44:04
【问题描述】:
我们在控制器中有以下过滤器:
before_action :authenticate_api_request!, except: [:reply_messages]
before_action :community_uuid
before_action :is_user_blocked?, only: [:create, :like, :dislike, :flag, :reply_message]
before_action :user_confirmed_email?, only: [:create]
before_action :get_message, only: [:like, :dislike, :flag, :remove, :get_message_json, :reply_message, :reply_messages]
before_action :get_reply_message, only: [:reply_message]
before_action :get_group, only: [:create]
before_action :is_blocked_from_group?, only: [:create, :like, :dislike, :reply_message]
它们的执行顺序是:
user_confirmed_email?
get_message
get_reply_message
authenticate_api_request!
community_uuid
is_user_blocked?
get_group
is_blocked_from_group?
这里的问题是authenticate_api_request!, community_uuid and is_user_blocked? 在user_confirmed_email? 之后被调用。
它在 dev 和 staging 环境中正常工作,但在 qa 服务器上不能工作相同的代码,即使复制相同的代码也不明白为什么会发生这种情况。
【问题讨论】:
-
你的问题是什么?
-
过滤器没有重复“它在开发和登台环境中正常工作,但在 qa 服务器上不能使用相同的代码,即使复制相同的代码也不明白为什么会发生这种情况。”
标签: ruby-on-rails ruby ruby-on-rails-3