rubocop corrections

This commit is contained in:
Karol Selak 2021-03-22 03:16:29 +01:00
parent c63c6bc448
commit de29815686
72 changed files with 468 additions and 311 deletions

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateAuthors < ActiveRecord::Migration[6.1]
def change
create_table :authors do |t|
@ -7,6 +9,6 @@ class CreateAuthors < ActiveRecord::Migration[6.1]
t.timestamps
end
add_index :authors, [ :first_name, :last_name ]
add_index :authors, %i[first_name last_name]
end
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateBooks < ActiveRecord::Migration[6.1]
def change
create_table :books do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateAuthorsBooks < ActiveRecord::Migration[6.1]
def change
create_table :authors_books do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateUsers < ActiveRecord::Migration[6.1]
def change
create_table :users do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ChangeUsernameToEmail < ActiveRecord::Migration[6.1]
def change
rename_column :users, :username, :email

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddPasswordRecoveryCodeToUsers < ActiveRecord::Migration[6.1]
def change
add_column :users, :password_recovery_code, :string

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ChangePasswordRecoveryCodeToRecoveryPasswordDigest < ActiveRecord::Migration[6.1]
def change
rename_column :users, :password_recovery_code, :recovery_password_digest

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddRoleToUsers < ActiveRecord::Migration[6.1]
def change
add_column :users, :role, :integer

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddStatusToUsers < ActiveRecord::Migration[6.1]
def change
add_column :users, :status, :integer

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateAuditRecords < ActiveRecord::Migration[6.1]
def change
create_table :audit_records do |t|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AddQuantityToBooks < ActiveRecord::Migration[6.1]
def change
add_column :books, :quantity, :integer

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class CreateBooksUsers < ActiveRecord::Migration[6.1]
def change
create_table :books_users do |t|