Module: Workarea::Warnings
Instance Method Summary collapse
- #check ⇒ Object
- #check_auto_capture ⇒ Object
- #check_dragonfly_config ⇒ Object
- #check_mongo_notable_scan ⇒ Object
- #check_timezone ⇒ Object
Instance Method Details
#check ⇒ Object
5 6 7 8 9 10 |
# File 'lib/workarea/warnings.rb', line 5 def check check_timezone check_mongo_notable_scan check_dragonfly_config check_auto_capture end |
#check_auto_capture ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/workarea/warnings.rb', line 66 def check_auto_capture if Workarea.config.auto_capture warn "**************************************************\n\u26D4\uFE0F WARNING: Workarea is configured with Workarea.config.auto_capture.\n\nIn v3.5, this is being deprecated to allow more flexibility based on the types\nof items in the order.\n\nYou should set Workarea.config.checkout_payment_action instead. You can set it\nfor each type of order, here are the defaults:\n {\nshipping: 'authorize!',\npartial_shipping: 'authorize!',\nno_shipping: 'purchase!'\n }\n\nTo achieve the same functionality as Workarea.config.auto_capture, you'd set:\n {\nshipping: 'purchase!',\npartial_shipping: 'purchase!',\nno_shipping: 'purchase!'\n }\n\n**************************************************\n eos\n end\nend\n" |
#check_dragonfly_config ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/workarea/warnings.rb', line 46 def check_dragonfly_config if !Rails.env.test? && !Rails.env.development? && Dragonfly.app(:workarea).datastore.is_a?(Dragonfly::FileDataStore) warn "**************************************************\n\u26D4\uFE0F WARNING: Dragonfly is configured to use the filesystem.\n\nThis means all dragonfly assets (assets, product images, etc.) will be stored\nlocally and not accessible to all servers within your environment.\n\nWe recommend using S3 when running in a live environment by setting\nWORKAREA_S3_REGION and WORKAREA_S3_BUCKET_NAME in your environment variables.\nWorkarea will automatically configure Dragonfly to use S3 if those values\nare present.\n**************************************************\n eos\n end\nend\n" |
#check_mongo_notable_scan ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/workarea/warnings.rb', line 27 def check_mongo_notable_scan if (Rails.env.development? && !Workarea.config.skip_service_connections && Configuration::Mongoid.indexes_enforced?) warn "**************************************************\n\u26D4\uFE0F WARNING: MongoDB is configured with notablescan.\n\nThis means that MongoDB won't run queries that require a collection scan and will return an error.\nWorkarea turns this on for running tests to assert that queries have indexes, and turns it off at the end of the test run.\nSince you're not running in the test environment and this is turned on, it might mean the test process was killed, preventing Workarea from turning it off.\n\nTo turn this off, start the mongo shell and run this command:\ndb.getSiblingDB(\"admin\").runCommand( { setParameter: 1, notablescan: 0 } )\n**************************************************\n eos\n end\nend\n" |
#check_timezone ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/workarea/warnings.rb', line 12 def check_timezone if Rails.application.config.time_zone == 'UTC' warn "**************************************************\n\u26D4\uFE0F WARNING: Rails.application.config.time_zone is set to UTC, which you \\\nprobably don't want.\nAs of Workarea 3.2, we use that value as the standard \\\ntimezone for the admin side of the application.\nWe recommend setting this to the timezone of the retailer. Contact them to \\\nfind their preference.\n**************************************************\n eos\n end\nend\n" |