add item set and relation
This commit is contained in:
2
app/models/item_set.rb
Normal file
2
app/models/item_set.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class ItemSet < ApplicationRecord
|
||||
end
|
||||
2
app/models/menu_instance_item_set.rb
Normal file
2
app/models/menu_instance_item_set.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class MenuInstanceItemSet < ApplicationRecord
|
||||
end
|
||||
2
app/models/menu_item_set.rb
Normal file
2
app/models/menu_item_set.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class MenuItemSet < ApplicationRecord
|
||||
end
|
||||
11
db/migrate/20170811070634_create_item_sets.rb
Normal file
11
db/migrate/20170811070634_create_item_sets.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateItemSets < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :item_sets do |t|
|
||||
t.string :name
|
||||
t.integer :min_selectable_qty
|
||||
t.integer :max_selectable_qty
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
10
db/migrate/20170811071108_create_menu_item_sets.rb
Normal file
10
db/migrate/20170811071108_create_menu_item_sets.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateMenuItemSets < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :menu_item_sets do |t|
|
||||
t.references :item_set_id, foreign_key: true
|
||||
t.references :menu_item_id, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
10
db/migrate/20170811071327_create_menu_instance_item_sets.rb
Normal file
10
db/migrate/20170811071327_create_menu_instance_item_sets.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateMenuInstanceItemSets < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :menu_instance_item_sets do |t|
|
||||
t.references :item_set_id, foreign_key: true
|
||||
t.references :menu_item_instance_id, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
5
spec/models/item_set_spec.rb
Normal file
5
spec/models/item_set_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ItemSet, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/menu_instance_item_set_spec.rb
Normal file
5
spec/models/menu_instance_item_set_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe MenuInstanceItemSet, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
5
spec/models/menu_item_set_spec.rb
Normal file
5
spec/models/menu_item_set_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe MenuItemSet, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
Reference in New Issue
Block a user