forked from keisukefunatsu/student-management
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] keisukefunatsu#74 Userの学年を上げるメソッドを実装した
- Loading branch information
Takashi Miyamoto
committed
Jun 4, 2016
1 parent
c0b6017
commit f412887
Showing
9 changed files
with
90 additions
and
9 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,17 @@ | ||
class Grade < ActiveHash::Base | ||
self.data = [ | ||
{code: 'ELEMENTARY_1', name: '小1', next_grade_code: 'ELEMENTARY_2'}, | ||
{code: 'ELEMENTARY_2', name: '小2', next_grade_code: 'ELEMENTARY_3'}, | ||
{code: 'ELEMENTARY_3', name: '小3', next_grade_code: 'ELEMENTARY_4'}, | ||
{code: 'ELEMENTARY_4', name: '小4', next_grade_code: 'ELEMENTARY_5'}, | ||
{code: 'ELEMENTARY_5', name: '小5', next_grade_code: 'ELEMENTARY_6'}, | ||
{code: 'ELEMENTARY_6', name: '小6', next_grade_code: 'JUNIOR_HIGH_1'}, | ||
{code: 'JUNIOR_HIGH_1', name: '中1', next_grade_code: 'JUNIOR_HIGH_2'}, | ||
{code: 'JUNIOR_HIGH_2', name: '中2', next_grade_code: 'JUNIOR_HIGH_3'}, | ||
{code: 'JUNIOR_HIGH_3', name: '中3', next_grade_code: 'HIGH_1'}, | ||
{code: 'HIGH_1', name: '高1', next_grade_code: 'HIGH_2'}, | ||
{code: 'HIGH_2', name: '高2', next_grade_code: 'HIGH_3'}, | ||
{code: 'HIGH_3', name: '高3', next_grade_code: 'GRADUATED'}, | ||
{code: 'GRADUATED', name: '卒業生', next_grade_code: 'GRADUATED'} | ||
] | ||
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,7 @@ | ||
class ChangeGradeToGradeCode < ActiveRecord::Migration | ||
def change | ||
remove_column :users, :grade, :string | ||
add_column :users, :grade_code, :string | ||
add_index :users, :grade_code | ||
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
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