Showing 66 of 66 total issues
Line is too long. [133/130] Open
Open
value.each { |attr_field, attr_value| variant.send("#{attr_field}=", attr_value) if variant.respond_to?("#{attr_field}=") }
- Exclude checks
Line is too long. [135/130] Open
Open
num_prods_for_delayed: 20, # From this number of products, the process is executed in delayed_job. Under it is processed immediately.
- Exclude checks
Line is too long. [165/130] Open
Open
@_parse ||= SolidusImportProducts::Parser.parse(:csv, data_file.url(:default, timestamp: false), { encoding_csv: encoding_csv, separator_char: separatorChar })
- Exclude checks
Line is too long. [135/130] Open
Open
attr_accessor :parser, :product_imports, :logger, :row, :col, :product_information, :variant_field, :skus_of_products_before_import
- Exclude checks
Avoid using update_attribute
because it skips validations. Open
Open
product.update_attribute(:deleted_at, nil) if product.deleted_at
- Read upRead up
- Exclude checks
This cop checks for the use of methods which skip validations which are listed in http://guides.rubyonrails.org/active_record_validations.html#skipping-validations
Example:
# bad
Article.first.decrement!(:view_count)
DiscussionBoard.decrement_counter(:post_count, 5)
Article.first.increment!(:view_count)
DiscussionBoard.increment_counter(:post_count, 5)
person.toggle :active
product.touch
Billing.update_all("category = 'authorized', author = 'David'")
user.update_attribute(website: 'example.com')
user.update_columns(last_request_at: Time.current)
Post.update_counters 5, comment_count: -1, action_count: 1
# good
user.update_attributes(website: 'example.com')
FileUtils.touch('file')
Please use Rails.root.join('path', 'to')
instead. Open
Open
product_image_path: "#{Rails.root}/lib/etc/product_data/product-images/", # The location of images on disk
- Read upRead up
- Exclude checks
This cop is used to identify usages of file path joining process
to use Rails.root.join
clause.
Example:
# bad Rails.root.join('app/models/goober') File.join(Rails.root, 'app/models/goober') "#{Rails.root}/app/models/goober"
# good Rails.root.join('app', 'models', 'goober')