Skip to content

Commit e82e2b9

Browse files
committed
added models
1 parent f19a1b9 commit e82e2b9

32 files changed

+267
-4
lines changed

app/javascript/packs/myjs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
$(function(){
22
console.log("got here");
3-
$.get("plans/1.json", function(data){
4-
console.log(data);
5-
});
3+
//$.get("plans/1.json", function(data){
4+
// console.log(data);
5+
//});
66
});
77

88
class Course {

app/models/catalog.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Catalog < ApplicationRecord
2+
end

app/models/catalog_course.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class CatalogCourse < ApplicationRecord
2+
belongs_to :catalog
3+
belongs_to :course
4+
end

app/models/category.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Category < ApplicationRecord
2+
belongs_to :requirements
3+
end

app/models/category_course.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class CategoryCourse < ApplicationRecord
2+
belongs_to :category
3+
belongs_to :course
4+
end

app/models/major.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Major < ApplicationRecord
2+
end

app/models/requirement.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class Requirement < ApplicationRecord
2+
belongs_to :major
3+
belongs_to :catalog
4+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class CreateCatalogs < ActiveRecord::Migration[6.0]
2+
def change
3+
create_table :catalogs do |t|
4+
t.integer :year
5+
6+
t.timestamps
7+
end
8+
end
9+
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class CreateCatalogCourses < ActiveRecord::Migration[6.0]
2+
def change
3+
create_table :catalog_courses do |t|
4+
t.references :catalog, null: false, foreign_key: true
5+
t.references :course, null: false, foreign_key: true
6+
7+
t.timestamps
8+
end
9+
end
10+
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class CreateCategories < ActiveRecord::Migration[6.0]
2+
def change
3+
create_table :categories do |t|
4+
t.string :name
5+
t.references :requirements, null: false, foreign_key: true
6+
7+
t.timestamps
8+
end
9+
end
10+
end

0 commit comments

Comments
 (0)