-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add version column to Timestamp table #200
Add version column to Timestamp table #200
Conversation
df5e216
to
f884b6f
Compare
Timestampモジュールの最上位あたりに、バージョニングの説明と各バージョンの挙動の差分が説明されたコメントが欲しいです。 |
@@ -14,6 +14,7 @@ class CreateTimestamp < ActiveRecord::Migration<%= migration_version %> | |||
t.bigint :prev_id | |||
t.boolean :latest, null: false, default: true | |||
t.boolean :hex, null: false, default: false |
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.
hexフラグは不要 by @azuchi
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.
67c0415 で削除してます
@@ -53,7 +56,8 @@ def initialize(attributes = nil) | |||
status: :init, | |||
timestamp_type: attributes[:timestamp_type] || :simple, | |||
prev_id: attributes[:prev_id], | |||
hex: hex | |||
hex: hex, | |||
version: attributes[:version] || "1" |
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.
version: attributes[:version] || "1" | |
version: attributes[:version] || "2" |
はどうでしょう?
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.
デフォルト値は不要 by @azuchi
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.
67c0415 で修正してます
98d6739
to
d62180c
Compare
|
d62180c
to
67c0415
Compare
# - version [String] Version of the timestamp recording method. | ||
# The format in which the timestamp is recorded differs depending on the version. | ||
# Version "1" treats the specified content and prefix as a binary string. | ||
# Version "2" treats the specified content and prefix as a hexadecimal string with the string set to prefix and content. |
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.
version が 1, 2 以外の場合は ArgumentError にした方が良いと思います。
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.
バリデーションでチェックしているようですね。
No description provided.