-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from Purple-Stock/feat/add-items-to-count
Feat/add items to count
- Loading branch information
Showing
7 changed files
with
219 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# == Schema Information | ||
# | ||
# Table name: items | ||
# | ||
# id :bigint not null, primary key | ||
# description :string | ||
# discount :decimal(, ) | ||
# ipi_tax :decimal(, ) | ||
# long_description :string | ||
# quantity :integer | ||
# sku :string | ||
# unity :integer | ||
# value :decimal(, ) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# account_id :integer | ||
# bling_order_item_id :bigint | ||
# product_id :bigint | ||
# | ||
class Item < ApplicationRecord | ||
belongs_to :account | ||
belongs_to :product | ||
belongs_to :bling_order_item | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class CreateItems < ActiveRecord::Migration[7.0] | ||
def change | ||
create_table :items do |t| | ||
t.string :sku | ||
t.integer :unity | ||
t.integer :quantity | ||
t.decimal :discount | ||
t.decimal :value | ||
t.decimal :ipi_tax | ||
t.string :description | ||
t.string :long_description | ||
t.bigint :product_id | ||
t.integer :account_id | ||
t.bigint :bling_order_item_id | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# == Schema Information | ||
# | ||
# Table name: items | ||
# | ||
# id :bigint not null, primary key | ||
# description :string | ||
# discount :decimal(, ) | ||
# ipi_tax :decimal(, ) | ||
# long_description :string | ||
# quantity :integer | ||
# sku :string | ||
# unity :integer | ||
# value :decimal(, ) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# account_id :integer | ||
# bling_order_item_id :bigint | ||
# product_id :bigint | ||
# | ||
require 'rails_helper' | ||
|
||
RSpec.describe Item, type: :model do | ||
describe 'associations' do | ||
it { is_expected.to belong_to(:product) } | ||
it { is_expected.to belong_to(:account) } | ||
it { is_expected.to belong_to(:bling_order_item) } | ||
end | ||
|
||
describe 'db columns' do | ||
it { is_expected.to have_db_column(:sku) } | ||
it { is_expected.to have_db_column(:unity) } | ||
it { is_expected.to have_db_column(:value) } | ||
it { is_expected.to have_db_column(:quantity) } | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.