chore: rubocop
chore: fix api test conventions chore: rubocop -A spec/ chore: more rubocop -A fix failing test rubocop fixes removes helper methods that are in my opinion dead code more rubocop fixes rubocop -a --auto-gen-config
This commit is contained in:
parent
f6fb804bbe
commit
fb2b4d8a8a
331 changed files with 4263 additions and 4507 deletions
|
|
@ -1,17 +1,17 @@
|
|||
class CreateArticles < ActiveRecord::Migration[4.2]
|
||||
SAMPLE_ARTICLE_NAMES = ['banana', 'kiwi', 'strawberry']
|
||||
SAMPLE_ARTICLE_NAMES = %w[banana kiwi strawberry]
|
||||
|
||||
def self.up
|
||||
create_table :articles do |t|
|
||||
t.column :name, :string, :null => false
|
||||
t.column :supplier_id, :integer, :null => false
|
||||
t.column :article_category_id, :integer, :null => false
|
||||
t.column :unit, :string, :null => false
|
||||
t.column :name, :string, null: false
|
||||
t.column :supplier_id, :integer, null: false
|
||||
t.column :article_category_id, :integer, null: false
|
||||
t.column :unit, :string, null: false
|
||||
t.column :note, :string
|
||||
t.column :availability, :boolean, :default => true, :null => false
|
||||
t.column :availability, :boolean, default: true, null: false
|
||||
t.column :current_price_id, :integer
|
||||
end
|
||||
add_index(:articles, :name, :unique => true)
|
||||
add_index(:articles, :name, unique: true)
|
||||
|
||||
# Create 30 sample articles...
|
||||
puts "Create 3 articles of the supplier '#{CreateSuppliers::SUPPLIER_SAMPLE}'..."
|
||||
|
|
@ -20,14 +20,14 @@ class CreateArticles < ActiveRecord::Migration[4.2]
|
|||
|
||||
SAMPLE_ARTICLE_NAMES.each do |a|
|
||||
puts 'Create Article ' + a
|
||||
Article.create(:name => a,
|
||||
:supplier => supplier,
|
||||
:article_category => category,
|
||||
:unit => '500g',
|
||||
:note => 'delicious',
|
||||
:availability => true)
|
||||
Article.create(name: a,
|
||||
supplier: supplier,
|
||||
article_category: category,
|
||||
unit: '500g',
|
||||
note: 'delicious',
|
||||
availability: true)
|
||||
end
|
||||
raise "Failed!" unless Article.find(:all).length == SAMPLE_ARTICLE_NAMES.length
|
||||
raise 'Failed!' unless Article.find(:all).length == SAMPLE_ARTICLE_NAMES.length
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue