Browse Source
_todo_ --------- Co-authored-by: Claire <claire.github-309c@sitedethib.com> Co-authored-by: Essem <smswessem@gmail.com> Co-authored-by: Jakob Gillich <jakob@gillich.me> Co-authored-by: David Aaron <1858430+suddjian@users.noreply.github.com> Co-authored-by: Matt Jankowski <matt@jankowski.online> Co-authored-by: Jonathan de Jong <jonathandejong02@gmail.com>hometown-3.5.14-merge v3.5.17+hometown-1.0.8
25 changed files with 239 additions and 74 deletions
@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true |
||||
|
||||
module DatetimeClampingConcern |
||||
extend ActiveSupport::Concern |
||||
|
||||
MIN_ISO8601_DATETIME = '0000-01-01T00:00:00Z'.to_datetime.freeze |
||||
MAX_ISO8601_DATETIME = '9999-12-31T23:59:59Z'.to_datetime.freeze |
||||
|
||||
class_methods do |
||||
def clamp_date(datetime) |
||||
datetime.clamp(MIN_ISO8601_DATETIME, MAX_ISO8601_DATETIME) |
||||
end |
||||
end |
||||
end |
||||
@ -1,6 +1,8 @@
|
||||
# frozen_string_literal: true |
||||
|
||||
Fabricator(:account_stat) do |
||||
account nil |
||||
statuses_count "" |
||||
following_count "" |
||||
followers_count "" |
||||
account { Fabricate.build(:account) } |
||||
statuses_count '123' |
||||
following_count '456' |
||||
followers_count '789' |
||||
end |
||||
|
||||
Loading…
Reference in new issue