europeana-feedback-button 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.codeclimate.yml +5 -0
- data/.rubocop.yml +2 -8
- data/.travis.yml +1 -2
- data/Gemfile +11 -6
- data/README.md +17 -7
- data/Rakefile +1 -0
- data/app/controllers/europeana/feedback_button/application_controller.rb +28 -0
- data/app/controllers/europeana/feedback_button/feedback_controller.rb +20 -12
- data/app/mailers/europeana/feedback_button/feedback_mailer.rb +9 -6
- data/app/models/europeana/feedback_button/feedback.rb +21 -0
- data/app/validators/europeana/feedback_button/word_count_validator.rb +26 -0
- data/app/views/concerns/europeana/feedback_button/feedbackable_view.rb +5 -5
- data/app/views/europeana/feedback_button/feedback_mailer/post.text.erb +2 -0
- data/bin/rails +19 -5
- data/config/routes.rb +1 -0
- data/europeana-feedback-button.gemspec +7 -10
- data/lib/europeana/feedback_button.rb +32 -1
- data/lib/europeana/feedback_button/engine.rb +2 -1
- data/lib/europeana/feedback_button/version.rb +2 -1
- data/lib/generators/europeana/feedback_button/install_generator.rb +15 -0
- data/lib/generators/europeana/feedback_button/templates/europeana_feedback_button.rb +8 -0
- data/spec/controllers/feedback_controller_spec.rb +82 -19
- data/spec/dummy/Rakefile +2 -1
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/assets/javascripts/application.js +2 -1
- data/spec/dummy/app/assets/stylesheets/application.css +3 -3
- data/spec/dummy/app/controllers/application_controller.rb +1 -3
- data/spec/dummy/app/controllers/welcome_controller.rb +3 -5
- data/spec/dummy/app/helpers/application_helper.rb +1 -0
- data/spec/dummy/app/jobs/application_job.rb +4 -0
- data/spec/dummy/app/mailers/application_mailer.rb +2 -1
- data/spec/dummy/app/views/layouts/application.html.erb +9 -9
- data/spec/dummy/app/views/layouts/mailer.html.erb +10 -6
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +2 -1
- data/spec/dummy/bin/rails +2 -1
- data/spec/dummy/bin/rake +1 -0
- data/spec/dummy/bin/setup +16 -16
- data/spec/dummy/bin/update +30 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +3 -1
- data/spec/dummy/config/application.rb +12 -18
- data/spec/dummy/config/boot.rb +3 -2
- data/spec/dummy/config/environment.rb +2 -1
- data/spec/dummy/config/environments/development.rb +24 -20
- data/spec/dummy/config/environments/production.rb +22 -26
- data/spec/dummy/config/environments/test.rb +10 -6
- data/spec/dummy/config/initializers/application_controller_renderer.rb +9 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +26 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/europeana_feedback_button.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +1 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +2 -6
- data/spec/dummy/config/locales/en.yml +10 -0
- data/spec/dummy/config/puma.rb +36 -0
- data/spec/dummy/config/routes.rb +2 -57
- data/spec/dummy/config/spring.rb +8 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/404.html +6 -6
- data/spec/dummy/public/422.html +6 -6
- data/spec/dummy/public/500.html +6 -6
- data/{app/assets/images/europeana_feedback_button/.keep → spec/dummy/public/apple-touch-icon-precomposed.png} +0 -0
- data/{app/models/.keep → spec/dummy/public/apple-touch-icon.png} +0 -0
- data/spec/lib/europeana/feedback_button_spec.rb +21 -0
- data/spec/mailers/feedback_mailer_spec.rb +54 -0
- data/spec/models/feedback_spec.rb +25 -0
- data/spec/spec_helper.rb +11 -1
- metadata +52 -53
- data/QUICKSTART.md +0 -30
- data/app/assets/javascripts/europeana_feedback_button/application.js +0 -13
- data/app/assets/stylesheets/europeana_feedback_button/application.css +0 -15
- data/app/helpers/europeana/feedback_button/application_helper.rb +0 -7
- data/app/helpers/europeana/feedback_button/feedback_helper.rb +0 -12
- data/app/views/layouts/europeana/feedback_button/application.html.erb +0 -14
- data/config/initializers/action_mailer.rb +0 -2
- data/lib/tasks/europeana_feedback_button_tasks.rake +0 -5
- data/spec/dummy/README.rdoc +0 -28
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/initializers/assets.rb +0 -12
- data/spec/dummy/config/initializers/session_store.rb +0 -4
- data/spec/dummy/config/secrets.yml +0 -22
- data/spec/helpers/feedback_helper_spec.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b94361c1bc78192b1cc1457df6b77407ed3ad5435a3e0538031ef958f426934b
|
4
|
+
data.tar.gz: 43d3ffbf8b53ba737b4f4aa7beebea7d3bfcccbeb33432b7a662566722cfe8d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d2c5f733f9baa166193392c8d5b3c2413202c633c3bbb4ae56e62306a9673fa6c78c81c8c3c5be1133a863c3b0066ab9a5d8abd51378457aa477f3defe8bd3f
|
7
|
+
data.tar.gz: 158dcc448e4cac5fbcaa3d8e814d5d3012bcc57b8641bdc85b942eeb43dd123e3fe03613dce0283fcfc43a87a7d4efc8256a56307fc50fe6719c9713b254147f
|
data/.codeclimate.yml
ADDED
data/.rubocop.yml
CHANGED
@@ -3,7 +3,7 @@ AllCops:
|
|
3
3
|
- "vendor/**/*"
|
4
4
|
- "db/schema.rb"
|
5
5
|
UseCache: false
|
6
|
-
TargetRubyVersion: 2.
|
6
|
+
TargetRubyVersion: 2.5
|
7
7
|
Style/CollectionMethods:
|
8
8
|
Description: Preferred collection methods.
|
9
9
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
@@ -41,7 +41,6 @@ Style/IfUnlessModifier:
|
|
41
41
|
Description: Favor modifier if/unless usage when you have a single-line body.
|
42
42
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
43
43
|
Enabled: false
|
44
|
-
MaxLineLength: 80
|
45
44
|
Style/OptionHash:
|
46
45
|
Description: Don't use option hashes when you can use keyword arguments.
|
47
46
|
Enabled: false
|
@@ -125,11 +124,6 @@ Style/TrailingCommaInArguments:
|
|
125
124
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
126
125
|
Enabled: false
|
127
126
|
EnforcedStyleForMultiline: no_comma
|
128
|
-
Style/TrailingCommaInLiteral:
|
129
|
-
Description: 'Checks for trailing comma in array and hash literals.'
|
130
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
131
|
-
Enabled: false
|
132
|
-
EnforcedStyleForMultiline: no_comma
|
133
127
|
Metrics/AbcSize:
|
134
128
|
Description: A calculated magnitude based on number of assignments, branches, and
|
135
129
|
conditions.
|
@@ -241,7 +235,7 @@ Lint/HandleExceptions:
|
|
241
235
|
Description: Don't suppress exception.
|
242
236
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
243
237
|
Enabled: false
|
244
|
-
Lint/
|
238
|
+
Lint/LiteralAsCondition:
|
245
239
|
Description: Checks of literals used in conditions.
|
246
240
|
Enabled: false
|
247
241
|
Lint/LiteralInInterpolation:
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,14 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
source 'https://rubygems.org'
|
3
4
|
|
4
|
-
# Specify your gem's dependencies in europeana-
|
5
|
+
# Specify your gem's dependencies in europeana-feedback-button.gemspec
|
5
6
|
gemspec
|
6
7
|
|
7
|
-
group :test do
|
8
|
-
gem '
|
8
|
+
group :test, :develop do
|
9
|
+
gem 'rails', '> 5.2', '< 6'
|
10
|
+
gem 'rubocop', '0.53', require: false
|
9
11
|
end
|
10
12
|
|
11
|
-
group :
|
12
|
-
gem '
|
13
|
-
|
13
|
+
group :develop do
|
14
|
+
gem 'brakeman'
|
15
|
+
end
|
16
|
+
|
17
|
+
group :test do
|
18
|
+
gem 'simplecov', require: false
|
14
19
|
end
|
data/README.md
CHANGED
@@ -1,21 +1,31 @@
|
|
1
1
|
# Europeana::FeedbackButton
|
2
2
|
|
3
|
-
[](https://travis-ci.org/europeana/europeana-feedback-button) [](https://travis-ci.org/europeana/europeana-feedback-button) [](https://hakiri.io/github/europeana/europeana-feedback-button/develop) [](https://codeclimate.com/github/europeana/europeana-feedback-button/maintainability) [](https://codeclimate.com/github/europeana/europeana-feedback-button/test_coverage)
|
4
4
|
|
5
|
-
|
5
|
+
Rails engine providing feedback functionality for various Europeana websites.
|
6
6
|
|
7
7
|
## Usage
|
8
8
|
|
9
|
-
|
9
|
+
### Include gem
|
10
10
|
|
11
|
-
|
11
|
+
* ``gem 'europeana-feedback-button', require: 'europeana/feedback_button'``
|
12
|
+
* Run ``bundle install``
|
12
13
|
|
13
|
-
|
14
|
+
### Generate an initializer
|
14
15
|
|
15
|
-
|
16
|
+
* Run ``bundle exec rails g europeana:feedback_button:install``
|
17
|
+
* Edit config/initializers/europeana_feedback_button.rb to configure the engine
|
16
18
|
|
19
|
+
### Mount the engine
|
17
20
|
|
21
|
+
* In config/routes.rb add: ``mount Europeana::FeedbackButton::Engine, at: '/'``
|
22
|
+
|
23
|
+
### Add FeedbackableView to your views
|
24
|
+
|
25
|
+
* Add ``include Europeana::FeedbackButton::FeedbackableView`` to any view you want to have a feedback button. Add it to app/views/application_view.rb for feedback buttons on all pages.
|
18
26
|
|
19
27
|
## License
|
20
28
|
|
21
|
-
|
29
|
+
Licensed under the EUPL V.1.1.
|
30
|
+
|
31
|
+
For full details, see [LICENSE.md](LICENSE.md).
|
data/Rakefile
CHANGED
@@ -1,8 +1,36 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Europeana
|
3
4
|
module FeedbackButton
|
4
5
|
class ApplicationController < ActionController::Base
|
5
6
|
protect_from_forgery with: :exception
|
7
|
+
|
8
|
+
before_action :fail_unless_feedback_enabled
|
9
|
+
|
10
|
+
rescue_from ApplicationError do |exception|
|
11
|
+
respond_to do |format|
|
12
|
+
format.json do
|
13
|
+
response = { success: false, message: exception.message }
|
14
|
+
response[:errors] = exception.errors if exception.errors.present?
|
15
|
+
render json: response, status: 400
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
rescue_from NoRecipientError do |exception|
|
21
|
+
respond_to do |format|
|
22
|
+
format.json do
|
23
|
+
response = { success: false, message: exception.message }
|
24
|
+
render json: response, status: 500
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
protected
|
30
|
+
|
31
|
+
def fail_unless_feedback_enabled
|
32
|
+
fail NoRecipientError, 'Feedback is not enabled' unless Europeana::FeedbackButton.enabled?
|
33
|
+
end
|
6
34
|
end
|
7
35
|
end
|
8
36
|
end
|
@@ -1,25 +1,33 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Europeana
|
3
4
|
module FeedbackButton
|
4
|
-
class FeedbackController < ApplicationController
|
5
|
-
include FeedbackHelper
|
6
|
-
|
5
|
+
class FeedbackController < Europeana::FeedbackButton::ApplicationController
|
7
6
|
def create
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
feedback = Feedback.new(feedback_params)
|
8
|
+
|
9
|
+
feedback.validate
|
10
|
+
|
11
|
+
unless feedback.valid?
|
12
|
+
fail ApplicationError.new('Feedback is invalid. See "errors" for details.',
|
13
|
+
errors: feedback.errors.messages)
|
14
|
+
end
|
15
|
+
|
16
|
+
FeedbackMailer.post(**mailer_post_args).deliver_later
|
17
|
+
|
18
|
+
respond_to do |format|
|
19
|
+
format.json { render json: { success: true } }
|
16
20
|
end
|
17
21
|
end
|
18
22
|
|
19
23
|
private
|
20
24
|
|
25
|
+
def feedback_params
|
26
|
+
@feedback_params ||= params.permit(:text, :type, :page, :email, :privacy_policy)
|
27
|
+
end
|
28
|
+
|
21
29
|
def mailer_post_args
|
22
|
-
|
30
|
+
feedback_params.to_h.symbolize_keys.slice(:text, :type, :page, :email)
|
23
31
|
end
|
24
32
|
end
|
25
33
|
end
|
@@ -1,18 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Europeana
|
3
4
|
module FeedbackButton
|
4
5
|
class FeedbackMailer < ApplicationMailer
|
5
|
-
|
6
|
-
|
7
|
-
def post(text:, type:, page:, ip:)
|
8
|
-
fail Errors::NoRecipient unless feedback_enabled?
|
6
|
+
def post(text:, type:, page:, email: nil)
|
7
|
+
fail NoRecipientError unless Europeana::FeedbackButton.enabled?
|
9
8
|
|
10
9
|
@text = text
|
11
10
|
@type = type
|
12
11
|
@page = page
|
13
|
-
@
|
12
|
+
@email = email
|
14
13
|
|
15
|
-
|
14
|
+
mail_options = {
|
15
|
+
to: Europeana::FeedbackButton.mail_to,
|
16
|
+
subject: text.truncate(100, separator: ' ')
|
17
|
+
}
|
18
|
+
mail(mail_options)
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Europeana
|
4
|
+
module FeedbackButton
|
5
|
+
class Feedback
|
6
|
+
include ActiveModel::Model
|
7
|
+
|
8
|
+
MAX_LENGTH = 400
|
9
|
+
MIN_WORDS = 5
|
10
|
+
TYPES = %w(comment correction bug).freeze
|
11
|
+
|
12
|
+
attr_accessor :text, :type, :page, :email, :privacy_policy
|
13
|
+
|
14
|
+
validates :text, :type, :page, presence: true
|
15
|
+
validates :type, inclusion: { in: TYPES }
|
16
|
+
validates :privacy_policy, acceptance: true, allow_nil: false, allow_blank: false
|
17
|
+
validates :text, length: { maximum: MAX_LENGTH }
|
18
|
+
validates :text, word_count: { minimum: MIN_WORDS }, allow_nil: true, allow_blank: true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Europeana
|
4
|
+
module FeedbackButton
|
5
|
+
class WordCountValidator < ActiveModel::EachValidator
|
6
|
+
def validate_each(record, attribute, value)
|
7
|
+
return if options[:allow_nil] && value.nil?
|
8
|
+
return if options[:allow_blank] && value.blank?
|
9
|
+
|
10
|
+
minimum = options[:minimum] || 5
|
11
|
+
validate_minimum_words(record, attribute, value, minimum)
|
12
|
+
end
|
13
|
+
|
14
|
+
def validate_minimum_words(record, attribute, value, minimum)
|
15
|
+
word_count = count_words(value)
|
16
|
+
unless word_count >= minimum
|
17
|
+
record.errors[attribute] << (options[:message] || "has too few words (#{word_count} < #{minimum})")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def count_words(value)
|
22
|
+
value&.strip&.scan(/\w+/)&.size || 0
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -2,18 +2,18 @@
|
|
2
2
|
|
3
3
|
module Europeana
|
4
4
|
module FeedbackButton
|
5
|
-
##
|
6
5
|
# Feedback form display methods
|
7
6
|
module FeedbackableView
|
8
7
|
extend ActiveSupport::Concern
|
9
|
-
include FeedbackHelper
|
10
8
|
|
11
9
|
def feedback
|
12
|
-
return nil unless
|
10
|
+
return nil unless Europeana::FeedbackButton.enabled?
|
11
|
+
|
13
12
|
{
|
14
13
|
form_action: europeana_feedback_button.feedback_path,
|
15
|
-
maxlength:
|
16
|
-
minwords:
|
14
|
+
maxlength: Europeana::FeedbackButton::Feedback::MAX_LENGTH,
|
15
|
+
minwords: Europeana::FeedbackButton::Feedback::MIN_WORDS,
|
16
|
+
privacy_policy_url: Europeana::FeedbackButton.privacy_policy_url
|
17
17
|
}
|
18
18
|
end
|
19
19
|
end
|
data/bin/rails
CHANGED
@@ -1,13 +1,27 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
|
-
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
|
4
3
|
|
5
|
-
|
6
|
-
|
4
|
+
# This command will automatically be run when you run "rails" with Rails gems
|
5
|
+
# installed from the root of your application.
|
6
|
+
|
7
|
+
ENGINE_ROOT = File.expand_path('..', __dir__)
|
8
|
+
ENGINE_PATH = File.expand_path('../lib/europeana/feedback_button/engine', __dir__)
|
9
|
+
APP_PATH = File.expand_path('../spec/dummy/config/application', __dir__)
|
7
10
|
|
8
11
|
# Set up gems listed in the Gemfile.
|
9
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('
|
12
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
10
13
|
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
11
14
|
|
12
|
-
require 'rails
|
15
|
+
require 'rails'
|
16
|
+
# Pick the frameworks you want:
|
17
|
+
require 'active_model/railtie'
|
18
|
+
require 'active_job/railtie'
|
19
|
+
# require "active_record/railtie"
|
20
|
+
# require "active_storage/engine"
|
21
|
+
require 'action_controller/railtie'
|
22
|
+
require 'action_mailer/railtie'
|
23
|
+
require 'action_view/railtie'
|
24
|
+
# require "action_cable/engine"
|
25
|
+
# require "sprockets/railtie"
|
26
|
+
# require "rails/test_unit/railtie"
|
13
27
|
require 'rails/engine/commands'
|
data/config/routes.rb
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# lib = File.expand_path('../lib', __FILE__)
|
3
|
-
# $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
2
|
|
5
|
-
$:.push File.expand_path('
|
3
|
+
$:.push File.expand_path('lib', __dir__)
|
6
4
|
|
7
5
|
require 'europeana/feedback_button/version'
|
8
6
|
|
9
7
|
Gem::Specification.new do |s|
|
10
8
|
s.name = 'europeana-feedback-button'
|
11
9
|
s.version = Europeana::FeedbackButton::VERSION
|
12
|
-
s.authors = ['Lutz Biedinger']
|
13
|
-
s.email =
|
10
|
+
s.authors = ['Lutz Biedinger', 'Richard Doe']
|
11
|
+
s.email = %w(lutz.biedinger@europeana.eu richard.doe@europeana.eu)
|
14
12
|
s.homepage = 'http://github.org/europeana/europeana-feedback-button'
|
15
13
|
s.summary = 'Europeana Feedback Button.'
|
16
14
|
s.description = 'An engine which allows the Europeana Feedback Button to be displayed.'
|
@@ -18,15 +16,14 @@ Gem::Specification.new do |s|
|
|
18
16
|
|
19
17
|
s.files = `git ls-files -z`.split("\x0")
|
20
18
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
21
|
-
s.require_paths =
|
19
|
+
s.require_paths = %w(lib)
|
22
20
|
|
23
|
-
s.required_ruby_version = '>= 2.
|
21
|
+
s.required_ruby_version = '>= 2.5'
|
24
22
|
|
25
|
-
s.add_dependency 'rails', '
|
23
|
+
s.add_dependency 'rails', '>= 4.2.7.1', '< 6'
|
26
24
|
|
27
25
|
s.add_development_dependency 'bundler', '~> 1.8'
|
28
26
|
s.add_development_dependency 'rake', '~> 11.0'
|
29
27
|
s.add_development_dependency 'rspec-rails', '~> 3.0'
|
30
|
-
s.add_development_dependency '
|
31
|
-
s.add_development_dependency 'shoulda-matchers', '~> 2.8'
|
28
|
+
s.add_development_dependency 'shoulda-matchers', '~> 3'
|
32
29
|
end
|
@@ -1,8 +1,39 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'europeana/feedback_button/engine'
|
3
4
|
|
4
5
|
module Europeana
|
5
6
|
module FeedbackButton
|
6
|
-
|
7
|
+
PRIVACY_POLICY_URL = 'https://www.europeana.eu/portal/rights/privacy.html'
|
8
|
+
|
9
|
+
class << self
|
10
|
+
# @return [String] Email recipient of feedback submissions
|
11
|
+
attr_accessor :mail_to
|
12
|
+
|
13
|
+
# @return [String] URL to the privacy policy users must accept
|
14
|
+
attr_accessor :privacy_policy_url
|
15
|
+
|
16
|
+
# Is feedback enabled?
|
17
|
+
#
|
18
|
+
# Feedback will be enabled if +mail_to+ is set.
|
19
|
+
#
|
20
|
+
# @return [Boolean]
|
21
|
+
def enabled?
|
22
|
+
mail_to.present?
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
self.privacy_policy_url = PRIVACY_POLICY_URL
|
27
|
+
|
28
|
+
class ApplicationError < StandardError
|
29
|
+
attr_reader :errors
|
30
|
+
|
31
|
+
def initialize(message, **options)
|
32
|
+
super(message)
|
33
|
+
@errors = options[:errors]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class NoRecipientError < StandardError; end
|
7
38
|
end
|
8
39
|
end
|