Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .annotaterb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
:position: before
:position_in_additional_file_patterns: before
:position_in_class: before
:position_in_factory: before
:position_in_fixture: before
:position_in_routes: before
:position_in_serializer: before
:position_in_test: before
:classified_sort: true
:exclude_controllers: true
:exclude_factories: false
:exclude_fixtures: false
:exclude_helpers: true
:exclude_scaffolds: true
:exclude_serializers: false
:exclude_sti_subclasses: false
:exclude_tests: false
:force: false
:format_markdown: false
:format_rdoc: false
:format_yard: false
:frozen: false
:ignore_model_sub_dir: false
:ignore_unknown_models: false
:include_version: false
:show_check_constraints: false
:show_complete_foreign_keys: false
:show_foreign_keys: true
:show_indexes: true
:simple_indexes: false
:sort: false
:timestamp: false
:trace: false
:with_comment: true
:with_column_comments: true
:with_table_comments: true
:active_admin: false
:command:
:debug: false
:hide_default_column_types: ''
:hide_limit_column_types: ''
:ignore_columns:
:ignore_routes:
:models: true
:routes: false
:skip_on_db_migrate: false
:target_action: :do_annotations
:wrapper:
:wrapper_close:
:wrapper_open:
:classes_default_to_s: []
:additional_file_patterns: []
:model_dir:
- app/models
:require: []
:root_dir:
- ''
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ group :development do
gem "sqlite3"

# Annotates Rails/ActiveRecord Models, routes, fixtures, and others based on the database schema.
gem "annotate"
gem "annotaterb"

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem "spring"
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ GEM
uri (>= 0.13.1)
addressable (2.8.9)
public_suffix (>= 2.0.2, < 8.0)
annotate (2.6.5)
activerecord (>= 2.3.0)
rake (>= 0.8.7)
annotaterb (4.24.0)
activerecord (>= 6.0.0)
activesupport (>= 6.0.0)
ast (2.4.3)
base64 (0.3.0)
bcrypt (3.1.22)
Expand Down Expand Up @@ -469,7 +469,7 @@ PLATFORMS
x86_64-linux-musl

DEPENDENCIES
annotate
annotaterb
bootsnap
bulma-rails (~> 0.9)
byebug
Expand Down
10 changes: 9 additions & 1 deletion app/models/barcode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@
# Table name: barcodes
#
# id :integer not null, primary key
# product_id :integer
# code :string default(""), not null
# created_at :datetime
# updated_at :datetime
# product_id :integer not null
#
# Indexes
#
# index_barcodes_on_code (code)
#
# Foreign Keys
#
# product_id (product_id => products.id)
#

class Barcode < ApplicationRecord
Expand Down
12 changes: 11 additions & 1 deletion app/models/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@
# Table name: orders
#
# id :integer not null, primary key
# user_id :integer
# price_cents :integer
# created_at :datetime not null
# updated_at :datetime not null
# transaction_id :integer
# user_id :integer not null
#
# Indexes
#
# index_orders_on_created_at (created_at)
# index_orders_on_user_id (user_id)
# index_orders_on_user_id_and_created_at (user_id,created_at)
#
# Foreign Keys
#
# user_id (user_id => users.id)
#
class Order < ApplicationRecord
include ApplicationHelper
Expand Down
9 changes: 7 additions & 2 deletions app/models/order_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
# Table name: order_items
#
# id :integer not null, primary key
# order_id :integer
# product_id :integer not null
# count :integer default(0)
# order_id :integer not null
# product_id :integer not null
#
# Foreign Keys
#
# order_id (order_id => orders.id)
# product_id (product_id => products.id)
#

class OrderItem < ApplicationRecord
Expand Down
16 changes: 8 additions & 8 deletions app/models/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
# Table name: products
#
# id :integer not null, primary key
# name :string not null
# price_cents :integer default(0), not null
# created_at :datetime
# updated_at :datetime
# avatar_file_name :string
# avatar_content_type :string
# avatar_file_size :integer
# avatar_file_name :string
# avatar_file_size :bigint
# avatar_updated_at :datetime
# category :integer default("food")
# stock :integer default(0), not null
# calories :integer
# category :integer default(0)
# deleted :boolean default(FALSE)
# name :string not null
# price_cents :integer default(0), not null
# stock :integer default(0), not null
# created_at :datetime
# updated_at :datetime
#

class Product < ApplicationRecord
Expand Down
24 changes: 17 additions & 7 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,29 @@
# Table name: users
#
# id :integer not null, primary key
# created_at :datetime
# updated_at :datetime
# remember_created_at :datetime
# admin :boolean default(FALSE)
# dagschotel_id :integer
# orders_count :integer default(0)
# frecency :integer default(0), not null
# koelkast :boolean default(FALSE)
# name :string
# orders_count :integer default(0)
# private :boolean default(FALSE)
# frecency :integer default(0), not null
# quickpay_hidden :boolean default(FALSE)
# remember_created_at :datetime
# userkey :string
# zauth_id :string
# created_at :datetime
# updated_at :datetime
# dagschotel_id :integer
# zauth_id :text not null
#
# Indexes
#
# index_users_on_koelkast (koelkast)
# index_users_on_orders_count (orders_count)
# index_users_on_zauth_id (zauth_id) UNIQUE
#
# Foreign Keys
#
# dagschotel_id (dagschotel_id => products.id)
#

class User < ApplicationRecord
Expand Down
3 changes: 0 additions & 3 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
# Mayor.create(name: 'Emanuel', city: cities.first)

if Rails.env.development?
require 'faker'
require 'tqdm'

puts "** Seeding database..."

puts "** Creating 50 users..."
Expand Down
8 changes: 8 additions & 0 deletions lib/tasks/annotate_rb.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This rake task was added by annotate_rb gem.

# Can set `ANNOTATERB_SKIP_ON_DB_TASKS` to be anything to skip this
if Rails.env.development? && ENV['ANNOTATERB_SKIP_ON_DB_TASKS'].nil?
require 'annotate_rb'

AnnotateRb::Core.load_rake_tasks
end
10 changes: 9 additions & 1 deletion spec/factories/barcodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@
# Table name: barcodes
#
# id :integer not null, primary key
# product_id :integer
# code :string default(""), not null
# created_at :datetime
# updated_at :datetime
# product_id :integer not null
#
# Indexes
#
# index_barcodes_on_code (code)
#
# Foreign Keys
#
# product_id (product_id => products.id)
#

FactoryBot.define do
Expand Down
9 changes: 7 additions & 2 deletions spec/factories/order_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
# Table name: order_items
#
# id :integer not null, primary key
# order_id :integer
# product_id :integer not null
# count :integer default(0)
# order_id :integer not null
# product_id :integer not null
#
# Foreign Keys
#
# order_id (order_id => orders.id)
# product_id (product_id => products.id)
#

FactoryBot.define do
Expand Down
12 changes: 11 additions & 1 deletion spec/factories/orders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@
# Table name: orders
#
# id :integer not null, primary key
# user_id :integer
# price_cents :integer
# created_at :datetime not null
# updated_at :datetime not null
# transaction_id :integer
# user_id :integer not null
#
# Indexes
#
# index_orders_on_created_at (created_at)
# index_orders_on_user_id (user_id)
# index_orders_on_user_id_and_created_at (user_id,created_at)
#
# Foreign Keys
#
# user_id (user_id => users.id)
#

require "faker"
Expand Down
16 changes: 8 additions & 8 deletions spec/factories/products.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
# Table name: products
#
# id :integer not null, primary key
# name :string not null
# price_cents :integer default(0), not null
# created_at :datetime
# updated_at :datetime
# avatar_file_name :string
# avatar_content_type :string
# avatar_file_size :integer
# avatar_file_name :string
# avatar_file_size :bigint
# avatar_updated_at :datetime
# category :integer default("food")
# stock :integer default(0), not null
# calories :integer
# category :integer default(0)
# deleted :boolean default(FALSE)
# name :string not null
# price_cents :integer default(0), not null
# stock :integer default(0), not null
# created_at :datetime
# updated_at :datetime
#

require "faker"
Expand Down
24 changes: 17 additions & 7 deletions spec/factories/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,29 @@
# Table name: users
#
# id :integer not null, primary key
# created_at :datetime
# updated_at :datetime
# remember_created_at :datetime
# admin :boolean default(FALSE)
# dagschotel_id :integer
# orders_count :integer default(0)
# frecency :integer default(0), not null
# koelkast :boolean default(FALSE)
# name :string
# orders_count :integer default(0)
# private :boolean default(FALSE)
# frecency :integer default(0), not null
# quickpay_hidden :boolean default(FALSE)
# remember_created_at :datetime
# userkey :string
# zauth_id :string
# created_at :datetime
# updated_at :datetime
# dagschotel_id :integer
# zauth_id :text not null
#
# Indexes
#
# index_users_on_koelkast (koelkast)
# index_users_on_orders_count (orders_count)
# index_users_on_zauth_id (zauth_id) UNIQUE
#
# Foreign Keys
#
# dagschotel_id (dagschotel_id => products.id)
#

require "faker"
Expand Down
10 changes: 9 additions & 1 deletion spec/models/barcode_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@
# Table name: barcodes
#
# id :integer not null, primary key
# product_id :integer
# code :string default(""), not null
# created_at :datetime
# updated_at :datetime
# product_id :integer not null
#
# Indexes
#
# index_barcodes_on_code (code)
#
# Foreign Keys
#
# product_id (product_id => products.id)
#

describe Barcode do
Expand Down
9 changes: 7 additions & 2 deletions spec/models/order_item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
# Table name: order_items
#
# id :integer not null, primary key
# order_id :integer
# product_id :integer not null
# count :integer default(0)
# order_id :integer not null
# product_id :integer not null
#
# Foreign Keys
#
# order_id (order_id => orders.id)
# product_id (product_id => products.id)
#

describe OrderItem do
Expand Down
Loading