pointless_feedback 4.1.3 → 4.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +3 -0
  3. data/app/models/pointless_feedback/message.rb +15 -1
  4. data/lib/pointless_feedback/version.rb +1 -1
  5. data/lib/pointless_feedback.rb +3 -0
  6. data/test/dummy/db/development.sqlite3 +0 -0
  7. data/test/dummy/db/schema.rb +1 -1
  8. data/test/dummy/db/test.sqlite3 +0 -0
  9. data/test/dummy/log/development.log +19 -0
  10. data/test/dummy/log/test.log +1268 -0
  11. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-San3EpdqmXucKjWKzj9Y4ohakTwPve802nHvuwO7Jo.cache +1 -0
  12. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-TbbWWLFMt3DZ-5B-vJndj1TPRC1zyxAx9oZII0qDIs.cache +2 -0
  13. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-pidKv4sRS1AHIdUq8SdhCbK7RBLxqZOj2J2IrQ2MNc.cache +1 -0
  14. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/0VTf0cLtjXR4AmORRQFKGgColA8oNkthmlSu3--4vkA.cache +0 -0
  15. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2LTXJO_QqTJ-5H5vls5NuO33l2HnQEPCKyys1rJ9CHU.cache +1 -0
  16. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/38mZ9NIe5KF1MIDDVKe1TEFBcbukU8SM-tJue0yS3wk.cache +0 -0
  17. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/6FZ81vWyUKy_DcxXDyZXdmGk9uRdL45m8mIRYeAAki0.cache +2 -0
  18. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/887XcE3QtqTB1awIHVQ-wZbPREASak6jnAIv5c8YkWs.cache +0 -0
  19. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/8UZRZEdnJXQI7pEZv5web_6NYGb4tsqrjexyklH9diw.cache +0 -0
  20. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/AZJGtFTJnm8JYaSaOYw5ksyiBB2wnq7xUR03pySV74s.cache +1 -0
  21. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/BrYu8MASRWPjOHXf27JbA7JxBQut8DGQqvNrSSbXcRo.cache +2 -0
  22. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/EWWsa5wkShiSKZ2PTmerV3jNjniPCSr6VKY8-AeWlDA.cache +2 -0
  23. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IOGWMsC0BM_CMkmkUN8bS1rbgafmhkAC8dcxottrV4Y.cache +0 -0
  24. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/KKSQk2Nb-fK9dAUIu54bCqJmsIl8CfyyMiL2kI6RhZA.cache +1 -0
  25. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/LKQqIm9BPozk5o1llvYa7OYd_UP5yTwGvgR42mgrcgg.cache +1 -0
  26. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/QrWJdwZgo4HAZ_7Vuhk9kz53541WB0e2f_EZd51klNs.cache +0 -0
  27. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UyxPIgqnOJ95iAcVy9cpZEBquCjaDqLAo-ZLVmMQTtY.cache +1 -0
  28. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ZbStkrcw5La9IsJfkcHZtBR6GXZIYYsZEkeoiAejt14.cache +1 -0
  29. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_F3f3F0jM19jFISuXW_iDifAYddNggPVDu0nZsAQ1qs.cache +0 -0
  30. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/cfiN2OwI0tIVEMcsMPNe3Ne9SI-eG5gK9SUCClSF5PU.cache +3 -0
  31. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ixs_LE4mzdmsCUhekBJ0_i4P33LTFSIfqISpj_BRXQM.cache +2 -0
  32. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/lUTpNNW813UzMkR7C2NJ5W6EhyzD2WMmeLp94WjnhLY.cache +1 -0
  33. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/rDNrWZd1_Nv7apS-pCv6ymh9c9MxOx_jBYxb0ecEbJM.cache +1 -0
  34. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uFVbUDnZucyvZeWah0qrbvBAmACAym8OCVUhBU80FV8.cache +0 -0
  35. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/xmAOdsDeC2k2YPPp5IBPPyzY4uZgOtYDMWM4RzxKGuI.cache +1 -0
  36. data/test/integration/pointless_feedback/feedback_submission_test.rb +23 -0
  37. data/test/tmp/config/initializers/pointless_feedback.rb +37 -0
  38. data/test/unit/pointless_feedback/message_test.rb +11 -0
  39. metadata +65 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 54626c7b8e32fc026a57ce137885229b2db6f4c7b13021e06a9d34f891f505fe
4
- data.tar.gz: 7a5e53932740a35c7584b4f6e3f3df3ed4a72cb5e6fe652fbded05e608858086
2
+ SHA1:
3
+ metadata.gz: d1006c4a0633cba8ab2619732e261e25b68ac3a5
4
+ data.tar.gz: 14b85dd1f5d81c67e23b2fd9a35ce6e884ffd44b
5
5
  SHA512:
6
- metadata.gz: a6b1bddd5ffeebdab8054d1154d7e4f6b1e3ab85c26e390472aa8b4e2f1a3b87d32e74694de9123000db34f45b559174f568a87aff53bdc16921bf5c46d5dfbb
7
- data.tar.gz: cae7b556e5f2dfba46f77e02ae817f8d2213b9bece2e51ee77a316cd4b93f6bfd70203a80fd631a121497c121fcd9a9d091bc17f91ee44e6746f1258c82e96cb
6
+ metadata.gz: 06eee19b847d1e7b6757b76ceab315e351b90c8089a7a9c9a9ebd3d97774d1f6f6705808c00d69d38488c826683b2f66a7f3d8996edaf3508cbaffb6588eefd6
7
+ data.tar.gz: 0c7fbe829f3af460bb03d50a934dcbee2d31ef52573a472f4d215e47609d4933b87ff36b4cd8932a33fdcbaf899af007861b327d1bece8b0f268867aa5e0c789
data/README.md CHANGED
@@ -92,6 +92,9 @@ Specifies what address the feedback email is sent from.
92
92
  **table_name:**
93
93
  Defaults to engine's namespace, e.g. `pointless_feedback_messages`. Change to any desired table for `PointlessFeedback::Message` model.
94
94
 
95
+ **invalid_words:**
96
+ List of words in the feedback description that would prevent an email from sending.
97
+
95
98
  **google_captcha_site_key & google_captcha_secret_key:**
96
99
  If you'd like to block out the robots, set up a Google Captcha instance:
97
100
 
@@ -11,7 +11,7 @@ module PointlessFeedback
11
11
  validates :email_address, :format => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
12
12
  validate :is_not_spam
13
13
 
14
- after_save :export_feedback, :unless => :honeypot_filled_in?
14
+ after_save :export_feedback, :unless => :ignore_feedback?
15
15
 
16
16
  private
17
17
 
@@ -45,10 +45,24 @@ module PointlessFeedback
45
45
  end
46
46
  end
47
47
 
48
+ def ignore_feedback?
49
+ honeypot_filled_in? || contains_invalid_words?
50
+ end
51
+
48
52
  def honeypot_filled_in?
49
53
  contact_info.present?
50
54
  end
51
55
 
56
+ def contains_invalid_words?
57
+ PointlessFeedback.invalid_words.each do |word|
58
+ if description.downcase.include? word.downcase
59
+ return true
60
+ end
61
+ end
62
+
63
+ false
64
+ end
65
+
52
66
  def is_not_spam
53
67
  if URI.extract(description || "").count >= 3
54
68
  errors.add(:description, "can not contain more than 2 http links (often a sign of spam)")
@@ -1,3 +1,3 @@
1
1
  module PointlessFeedback
2
- VERSION = "4.1.3"
2
+ VERSION = "4.1.4"
3
3
  end
@@ -52,6 +52,9 @@ module PointlessFeedback
52
52
  mattr_accessor :airtable_table_name
53
53
  @@airtable_table_name = nil
54
54
 
55
+ mattr_accessor :invalid_words
56
+ @@invalid_words = []
57
+
55
58
  # Default way to setup PointlessFeedback. Run rails generate
56
59
  # pointless_feedback_install to create a fresh initializer with all
57
60
  # configuration values.
Binary file
@@ -13,7 +13,7 @@
13
13
 
14
14
  ActiveRecord::Schema.define(version: 20130501182659) do
15
15
 
16
- create_table "pointless_feedback_messages", force: true do |t|
16
+ create_table "pointless_feedback_messages", force: :cascade do |t|
17
17
  t.string "name"
18
18
  t.string "email_address"
19
19
  t.string "topic"
Binary file
@@ -0,0 +1,19 @@
1
+  (1.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreatePointlessFeedbackMessages (20130501182659)
6
+  (0.1ms) begin transaction
7
+ DEPRECATION WARNING: `#timestamp` was called without specifying an option for `null`. In Rails 5, this behavior will change to `null: false`. You should manually specify `null: true` to prevent the behavior of your existing migrations from changing. (called from block in change at /Users/noahover/projects/pointless-feedback/db/migrate/20130501182659_create_pointless_feedback_messages.rb:9)
8
+  (0.5ms) CREATE TABLE "pointless_feedback_messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "email_address" varchar, "topic" varchar, "description" text, "created_at" datetime, "updated_at" datetime)
9
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20130501182659"]]
10
+  (1.1ms) commit transaction
11
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
12
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
13
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
14
+  (1.5ms) CREATE TABLE "pointless_feedback_messages" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "email_address" varchar, "topic" varchar, "description" text, "created_at" datetime, "updated_at" datetime) 
15
+  (1.4ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
16
+  (0.1ms) select sqlite_version(*)
17
+  (1.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
18
+  (0.1ms) SELECT version FROM "schema_migrations"
19
+  (1.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20130501182659')