In Rails 5 , ActiveSupport::TimeZone.zones_map is a private method. Therefore, if you want your validation to work, I suggest the following syntax:
validates :time_zone, inclusion: { in: ActiveSupport::TimeZone.all.map(&:name) }
kogitoja
source share