Remove unused Campaign model
The only way to use campaigns is to manually insert them in the database, which IMHO isn't very practical. We're going to change every piece of code that generates an Ahoy event and, in this case, the easiest way to change the Campaing model so it doesn't use Ahoy events is to simply remove it. Note we're keeping the database tables until we release a new version, just in case some Consul Democracy installations are using them. We'll inform in the release notes that we'll remove the campaigns table after the release, so existing installations using the `campaigns` table can move the data somewhere else before we remove the table.
This commit is contained in:
@@ -11,7 +11,6 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
before_action :ensure_signup_complete
|
||||
around_action :switch_locale
|
||||
before_action :track_email_campaign
|
||||
before_action :set_return_url
|
||||
|
||||
check_authorization unless: :devise_controller?
|
||||
@@ -91,13 +90,6 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
end
|
||||
|
||||
def track_email_campaign
|
||||
if params[:track_id]
|
||||
campaign = Campaign.find_by(track_id: params[:track_id])
|
||||
ahoy.track campaign.name if campaign.present?
|
||||
end
|
||||
end
|
||||
|
||||
def set_return_url
|
||||
if request.get? && !devise_controller? && is_navigational_format?
|
||||
store_location_for(:user, request.fullpath)
|
||||
|
||||
Reference in New Issue
Block a user