Auto correct rubocop style issues

This commit is contained in:
Patrick Gansterer 2022-02-20 16:15:22 +01:00
parent f260e607bf
commit 7e8c1d041d
39 changed files with 115 additions and 199 deletions

View file

@ -16,7 +16,7 @@ class CreateArticlePrices < ActiveRecord::Migration[4.2]
puts 'add prices to the sample articles'
CreateArticles::SAMPLE_ARTICLE_NAMES.each do |a|
puts 'Create Price for article ' + a
raise 'article #{a} not found!' unless article = Article.find_by_name(a)
raise "article #{a} not found!" unless article = Article.find_by_name(a)
new_price = ArticlePrice.new(:clear_price => rand(4) + 1,
:tax => 7.0,

View file

@ -16,7 +16,7 @@ class MigrateUserSettings < ActiveRecord::Migration[4.2]
begin
user = type.constantize.find(id)
rescue ActiveRecord::RecordNotFound
Rails.logger.debug "Can't find configurable object with type: #{type.inspect}, id: #{id.inspect}"
Rails.logger.debug { "Can't find configurable object with type: #{type.inspect}, id: #{id.inspect}" }
next
end
@ -27,7 +27,7 @@ class MigrateUserSettings < ActiveRecord::Migration[4.2]
# prepare value
value = YAML.load(old_setting.value)
value = value.nil? ? false : value
value = false if value.nil?
# set the settings_attributes (thanks to settings.merge! we can set them one by one)
user.settings_attributes = {

View file

@ -4,7 +4,10 @@ class CreateFinancialLinks < ActiveRecord::Migration[4.2]
t.text :note
end
add_column :financial_transactions, :financial_link_id, :integer, index: true
add_column :invoices, :financial_link_id, :integer, index: true
add_column :financial_transactions, :financial_link_id, :integer
add_column :invoices, :financial_link_id, :integer
add_index :financial_transactions, :financial_link_id
add_index :invoices, :financial_link_id
end
end