Neal Chambers
60cd84d565
Safely autocorrect Naming/BlockForwarding
...
Inspecting 1480 files
...................................................................................................................................................................C.......C..........C...............................................................................................................................................................................................................C...........................................................................................................C.........C...............................................................................................................................................................................................................................................................C........................................CC...C............................................................................................................................................................................................................................................................................................................................C.....................................................................................................................................................................................................C..............C.........C..CC.......C.....................................................................................................C...............
Offenses:
app/helpers/application_helper.rb:41:32: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def ng_form_for(name, *args, &block)
^^^^^^
app/helpers/application_helper.rb:44:75: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
form_for(name, *(args << options.merge(builder: AngularFormBuilder)), &block)
^^^^^^
app/helpers/application_helper.rb:49:37: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def method_missing(method, *args, &block)
^^^^^^
app/helpers/link_helper.rb:4:57: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def link_to_service(baseurl, name, html_options = {}, &block)
^^^^^^
app/helpers/link_helper.rb:8:51: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
link_to ext_url(baseurl, name), html_options, &block
^^^^^^
app/helpers/spree/admin/base_helper.rb:6:56: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def field_container(model, method, options = {}, &block)
^^^^^^
app/helpers/spree/admin/base_helper.rb:13:29: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
capture(&block),
^^^^^^
app/reflexes/application_reflex.rb:29:19: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def with_locale(&block)
^^^^^^
app/reflexes/application_reflex.rb:30:43: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
I18n.with_locale(current_user.locale, &block)
^^^^^^
app/services/cache_service.rb:8:43: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def self.cache(cache_key, options = {}, &block)
^^^^^^
app/services/cache_service.rb:9:48: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
Rails.cache.fetch cache_key.to_s, options, &block
^^^^^^
app/services/cache_service.rb:14:58: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def self.cached_data_by_class(cache_key, cached_class, &block)
^^^^^^
app/services/cache_service.rb:16:23: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
&block
^^^^^^
app/services/cache_service.rb:25:34: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def self.home_stats(statistic, &block)
^^^^^^
app/services/cache_service.rb:28:47: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
race_condition_ttl: 10, &block)
^^^^^^
app/services/current_order_locker.rb:12:31: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def self.around(controller, &block)
^^^^^^
app/services/current_order_locker.rb:13:55: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
lock_order_and_variants(controller.current_order, &block)
^^^^^^
lib/reporting/reports/enterprise_fee_summary/scope.rb:392:28: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def chain_to_scope(&block)
^^^^^^
lib/reporting/reports/enterprise_fee_summary/scope.rb:393:41: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
@scope = @scope.instance_eval(&block)
^^^^^^
lib/spree/core/controller_helpers/respond_with.rb:7:34: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def respond_with(*resources, &block)
^^^^^^
lib/spree/core/controller_helpers/respond_with.rb:13:64: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
return unless (collector = retrieve_collector_from_mimes(&block))
^^^^^^
lib/spree/core/delegate_belongs_to.rb:80:39: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def class_def(name, method = nil, &blk)
^^^^
lib/spree/core/delegate_belongs_to.rb:81:54: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
class_eval { method.nil? ? define_method(name, &blk) : define_method(name, method) }
^^^^
lib/spree/core/environment_extension.rb:22:31: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def create_method(name, &block)
^^^^^^
lib/spree/core/environment_extension.rb:23:51: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
self.class.__send__(:define_method, name, &block)
^^^^^^
spec/models/enterprise_caching_spec.rb:144:13: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def later(&block)
^^^^^^
spec/models/enterprise_caching_spec.rb:145:36: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
Timecop.travel(1.day.from_now, &block)
^^^^^^
spec/support/embedded_pages_helper.rb:5:26: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def on_embedded_page(&block)
^^^^^^
spec/support/embedded_pages_helper.rb:6:28: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
within_frame :frame, &block
^^^^^^
spec/support/preferences_helper.rb:11:31: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def reset_spree_preferences(&config_block)
^^^^^^^^^^^^^
spec/support/preferences_helper.rb:16:33: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
configure_spree_preferences(&config_block) if block_given?
^^^^^^^^^^^^^
spec/support/request/shop_workflow.rb:87:37: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def within_variant(variant = nil, &block)
^^^^^^
spec/support/request/shop_workflow.rb:90:22: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
within(selector, &block)
^^^^^^
spec/support/request/ui_component_helper.rb:4:23: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def browse_as_small(&block)
^^^^^^
spec/support/request/ui_component_helper.rb:5:39: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
browse_with_window_size(640, 480, &block)
^^^^^^
spec/support/request/ui_component_helper.rb:8:24: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def browse_as_medium(&block)
^^^^^^
spec/support/request/ui_component_helper.rb:9:40: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
browse_with_window_size(1024, 768, &block)
^^^^^^
spec/support/request/web_helper.rb:52:23: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def within_row(num, &block)
^^^^^^
spec/support/request/web_helper.rb:53:54: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
within("table.index tbody tr:nth-child(#{num})", &block)
^^^^^^
spec/swagger_helper.rb:77:19: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def param(args, &block)
^^^^^^
spec/swagger_helper.rb:78:45: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
public_send(:let, args) { instance_eval(&block) }
^^^^^^
spec/system/support/capybara_setup.rb:20:27: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
def using_session(name, &block)
^^^^^^
1480 files inspected, 42 offenses detected, 42 offenses corrected
2023-07-30 21:29:19 +09:00
Jean-Baptiste Bellet
1cf647e04b
Avoid line-break by wrapping into nowrap element
2023-07-17 14:00:48 +02:00
Maikel
014fb69d4b
Merge pull request #10964 from macanudo527/fix_linelength_bundle1
...
Fix Layout/LineLength - Bundle 1
2023-06-26 12:10:39 +10:00
Neal Chambers
1e4034534c
Fix Layout/LineLength
2023-06-23 09:08:04 +09:00
Matt-Yorkley
0f253bb2a0
Blank out product SKU when cloning a product
...
This was effectively being done before for the product's sku (stored on the master variant) via the #duplicate_variant method, but now it needs to be done explicitly on the product in #duplicate_product
2023-06-16 21:26:28 +01:00
Matt-Yorkley
1e36043a2e
Set unit_value to true when cloning a product
...
This value doesn't get persisted, but it's presence is validated. The product's duplicated variants store the actual :unit_value attribute
2023-06-16 21:23:44 +01:00
Matt-Yorkley
3ef7d2c9ff
Remove master variant from product
2023-06-16 21:23:44 +01:00
Matt-Yorkley
7dc1091bc2
Migrate product image from master variant to product
2023-06-16 21:23:44 +01:00
Matt-Yorkley
a20277c3a7
Completely remove option_values and option_types from the codebase
2023-06-01 10:12:19 +01:00
Gaetan Craig-Riou
d715b6b3bb
Spec fix LocalisedNumber validation to allow negative number
...
As part of this PR https://github.com/openfoodfoundation/openfoodnetwork/pull/10329
LocalisedNumber validation was tightened, but that means negative number
were not valid anymore.
This commit has been cherry-picked after this fix has already been
applied. Now we just change the order of characters in the regex because
humans are used to reading the minus at the beginning of the number. But
this change doesn't change the logic at all.
2023-05-15 10:55:59 +10:00
filipefurtad0
e7ab839fb3
Adds minus sign as validation criteria
...
Removes pending from passing examples
2023-05-14 23:02:44 +01:00
Konrad
b60a6fbd05
Merge pull request #10329 from thejwuscript/9861-improve-input-validation
...
Improve input validation on new and edit Payment Method pages
2023-05-03 16:11:21 +02:00
Maikel Linke
dae8703b02
Remove unused feature to intercept emails
...
This option came from Spree and we never used it. The config input field
is disabled in the admin interface and I checked our managed databases.
I don't think that we will want this feature in the future either.
Staging sends unmodified emails which is more realistic and we haven't
had a use case to intercept those emails. There's still the BCC option
if we need additional access.
2023-04-26 13:50:31 +10:00
David Cook
364ccc2146
Add comment
2023-04-18 09:39:39 +10:00
James Wu
29ddc68d20
Fix duplicate validation error message
2023-04-18 09:39:39 +10:00
James Wu
7af26e6579
Add errors for invalid input with number localization enabled
2023-04-18 09:39:39 +10:00
Mohamed ABDELLANI
788093c7cf
implement variant duplication
2022-10-25 11:23:35 +01:00
Mohamed ABDELLANI
f44228eef7
extract variant duplication logic into a separated function
2022-10-25 11:23:35 +01:00
Matt-Yorkley
c0ee72319f
Remove dead code: Product#variants?
...
This only makes sense in the context of Products which only have "master" variants, and we removed that option a while back.
Remove #variants? check from ProductStock concern
2022-10-19 16:30:12 +11:00
Philipp Winkler
bf53a02270
Add api key toggle view checkbox
2022-08-07 09:48:49 +02:00
Maikel Linke
bea080a9b1
Remove Paperclip
...
It has been replaced by Active Storage.
2022-06-01 17:16:55 +10:00
Maikel Linke
b7efa1b018
Replace Paperclip on Spree::Image
2022-06-01 17:16:55 +10:00
Nihal Mohammed
8ceeaaa7d4
Fix deprecated Object warning in lib/spree/localized_number
2022-03-15 05:35:43 +05:30
Matt-Yorkley
8a18a4de66
Clear up redirecting logic and path building
2022-01-29 10:08:51 +00:00
Matt-Yorkley
1953a2ef6a
Don't require stringex
2022-01-15 12:31:43 +00:00
Matt-Yorkley
6d2521bf5f
Remove Spree.user_class
...
This construct was previously used in Spree to switch out the user class with a dummy class during certain tests. We don't use this any more, so it's just mess.
🔥
2021-12-10 18:18:20 +00:00
Maikel Linke
207cc8908a
Remove useless assignments
...
Rubocop highlighted this. The todo list actually contains these files
but somehow the cop still runs and reports these as violations.
2021-12-10 09:26:57 +11:00
Maikel
c3076f0316
Merge pull request #8447 from Matt-Yorkley/keyword-args-deprecation
...
Fix keyword args deprecations
2021-11-17 17:09:15 +11:00
Matt-Yorkley
d0f572b051
Remove dead code: session[:guest_token]
...
This `session[:guest_token]` doesn't seem to ever be assigned anywhere in the codebase, and it doesn't seem to be read at any point either..? There are some various places where `current_order.token` is used and `session[:access_token]` is used, but not this.
As far as I can tell: it was part of an old version of Spree and related to the spree_auth_devise gem (which we no longer use).
2021-11-14 12:02:07 +00:00
Matt-Yorkley
0d8d4db41f
Fix keyword args deprecations
...
/home/runner/work/openfoodnetwork/openfoodnetwork/lib/spree/core/delegate_belongs_to.rb:75: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/runner/work/openfoodnetwork/openfoodnetwork/lib/spree/i18n.rb:20: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
2021-11-11 14:16:37 +00:00
Luis Azcuaga
e8fd89a6d2
Run rubocop over existing todo
2021-10-25 21:28:28 -05:00
Matt-Yorkley
1d5077061e
Remove andand
...
This old gem implemented some functionality for handling nils which is no longer needed, as it's provided natively by Ruby with the &. operator.
2021-09-08 14:28:31 +01:00
Matt-Yorkley
5725989343
Fix deprecated syntax in old controller helper
...
This syntax for rendering a file isn't valid in Rails 6.x...
2021-07-31 13:11:10 +01:00
Matt-Yorkley
2d69810c5d
Convert CalculatedAdjustments into a proper Concern and remove class_eval
2021-07-24 21:28:13 +01:00
Nihal Mohammed
e5bdaa603a
Setup pagy
2021-07-14 13:17:33 +01:00
Andy Brett
334b9b520a
removed deprecated calls to force_ssl; rely on config.force_ssl
2021-06-24 11:58:33 -07:00
Andy Brett
df0c98d013
Merge branch 'master' into rails61
2021-06-24 08:02:58 -07:00
Luis Ramos
e52937c113
Use rubocop auto correct to add frozen string literal to all files
...
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00
Luis Ramos
23627c5453
Run rubocop -a (safe corrections) removing all exceptions so all possible fixes are applied
...
9290 issues fixed
2021-06-17 22:19:26 +01:00
Luis Ramos
43401e4b5e
Fix double spree scope in i18n
...
Fix taken from spree: efba9f1a02
2021-06-13 18:19:29 -07:00
Matt-Yorkley
2de442f44d
Move taxing of enterprise fees to TaxRate
2021-06-06 20:16:03 +01:00
Matt-Yorkley
8c9733d8da
Remove included tax check from CalculatedAdjustments
...
This is handled in TaxRate now.
2021-06-06 20:16:03 +01:00
Andy Brett
d197b81351
Merge pull request #7606 from luisramos0/deprecation
...
[Rails 6.1] Fix deprecation warning in rails 6.0
2021-06-04 07:42:50 -07:00
Matt-Yorkley
7d38bec26d
Remove Spree::Config[:allow_ssl_in_development_and_test]
...
Unconditionally disables forced https-redirects in dev and test
2021-06-03 20:52:09 +01:00
Luis Ramos
cb6e626193
Remove require rails/all, this is already done in application.rb where we are loading only the rails modules we need
2021-06-01 22:34:04 +01:00
Matt-Yorkley
5868765087
Merge pull request #7673 from Matt-Yorkley/spree-config-caching
...
Fix clashing loggers
2021-05-25 11:09:33 +02:00
Matt-Yorkley
6377736f43
Allow :site_url to be picked up from ENV vars
2021-05-24 14:58:53 +01:00
Matt-Yorkley
1f6d872fa5
Add Spree copyright notice
2021-05-20 10:25:48 +01:00
Luis Ramos
d308e20871
Fix deprecation warning in rails 6.0
...
Warning: Class level methods will no longer inherit scoping from create in Rails 6.1
2021-05-10 21:03:24 +01:00
Andy Brett
6f20a23d47
Merge pull request #7436 from coopdevs/remove-duplicate-method
...
Replace duplicate #unauthorized method with module inclusion
2021-04-25 11:26:12 -07:00