-
-
Notifications
You must be signed in to change notification settings - Fork 108
Use 全国地方公共団体コード for Order #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0 means octal number in Ruby, which breaks when sorting: e.g. puts 010 => 8
a2266ec
to
87567c0
Compare
Some Japanese codes for regions start with 0. We should compare as String rather than Integer. cf. #219
87567c0
to
293ac4f
Compare
d.description = dojo['description'] | ||
d.logo = dojo['logo'] | ||
d.tags = dojo['tags'] | ||
d.url = dojo['url'] | ||
d.created_at = dojo['createdAt'] ? Time.zone.parse(dojo['createdAt']) : Time.zone.now | ||
d.created_at = d.new_record? ? Time.zone.now : d.created_at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue とは関係ないですが created_at が更新されてしまうバグを見つけたのでついでに直しました 🐛 🔍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
おぉ、これなにか意図があるのかと思っていました😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
やってしまったze! 🙈💦
@nalabjp 全国地方公共団体コードを |
.oO(CoderDojo 御茶ノ水からの申請が先ほどあったので、ついでにこのコミットに載せちゃいますね。master にコミットすると conflict しそうなので ><) |
手元で動かして問題なさそうだったので、デプロイしてみます 🚀✨ |
@@ -0,0 +1,6 @@ | |||
class ChangeOrderToInteger < ActiveRecord::Migration[5.1] | |||
def change | |||
change_column :dojos, :order, :string, default: '000000' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rollbackが必要になった時に戻せなくなる気がします。
こんな感じでup, downするほうが良いですね。
https://github.com/coderdojo-japan/coderdojo.jp/blob/5da47bf0e2541fc11a3ed7cc36bf75dab961fb66/db/migrate/20170820090605_change_column_type_dojo_event_services.rb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
型の変更自体は 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なるほど🤔 こっそり直せないか後で試してみます ><
良さそうに思いました😁 |
ですね 😆 レビューありがとうございます! 👏 |
This will fix #219 and can be a step to automate inserting Order column (#58), which enables us to remove
order
from dojos.yaml.