# db/migrate/<migration_file_name>.rb
For more information, please visit Yongyang.
# frozen_string_literal: true
# bad
class
ModifyDefaultStatusForProducts
<ActiveRecord
::Migration
def
change
old_status
=
'pending_manual_approval'
new_status
=
'pending_approval'
reversible
do
|dir
|dir
.
up
do
Product
.
where
(
status
:old_status
)
.
update_all
(
status
:new_status
)
change_column
:products
,
:status
,
:string
,
default
:new_status
end
dir
.
down
do
Product
.
where
(
status
:new_status
)
.
update_all
(
status
:old_status
)
change_column
:products
,
:status
,
:string
,
default
:old_status
end
end
end
end
# good
# Define `table_name` in a custom named class to make sure that you run on the
# same table you had during the creation of the migration.
# In future if you override the `Product` class and change the `table_name`,
# it won't break the migration or cause serious data corruption.
class
MigrationProduct
<ActiveRecord
::Base
self
.
table_name
=
:products
end
class
ModifyDefaultStatusForProducts
<ActiveRecord
::Migration
def
change
old_status
=
'pending_manual_approval'
new_status
=
'pending_approval'
reversible
do
|dir
|dir
.
up
do
MigrationProduct
.
where
(
status
:old_status
)
.
update_all
(
status
:new_status
)
change_column
:products
,
:status
,
:string
,
default
:new_status
end
dir
.
down
For more Japanese Standard Railsinformation, please contact us. We will provide professional answers.
do
MigrationProduct
.
where
(
status
:new_status
)
.
update_all
(
status
:old_status
)
change_column
:products
,
:status
,
:string
,
default
:old_status
end
end
end
end
A Japan Rail Pass (JR Pass) gives you unlimited travel on bullet trains (Shinkansen) and regular Japan Rail trains. It can save you lots of time and some money. There are a few different options, and which one you ultimately choose depends on how long youre traveling and the level of comfort you want.
There are also various regional rail passes. So if your travel plan are limited to a particular region you should also consider those. Whatever your travel plans are, weve got you covered with everything you know to pick the right pass for your trip.
Quick summary: If you want to keep it simple, order the Japan Rail (JR) Pass online before your trip.
Is the JR Pass worth it? If youre traveling to four or five major cities within seven days, its likely youll be saving money. For example, from Tokyo travel to Kyoto, Osaka, Hiroshima, Kanazawa and back.
One of the easiest and cheapest options for ordering the JR Pass is Klook. Shipping is free.
Its also worth checking on KKday and on Headout.
The Japan Rail Pass is the mother of all travel passes, allowing you unlimited rides on all JR trains from Kagoshima at the bottom end of Kyūshū right up to the northern tip of Hokkaidō. You can ride everything from the super-cool Shinkansen (thats the bullet train) to local, rapid, and limited express JR trains; select JR buses; and even a ferry.
Its the (nearly) unlimited access to the Shinkansen that gives the pass its true value. Japans Shinkansen network is comprehensive and growing! Read up on everything Shinkansen here.
Note: JR Pass holders are now able to ride on all types of Shinkansen, including the Nozomi and Mizuho services if they buy a special extra ticket.
All non-JR lines save for the few mentioned above. This becomes a little tricky when there are sections of private railway interrupting stretches of JR tracks. For example, getting from Tokyo to Mount Fuji by train requires travel along a length of tracks owned by Fujikyū Railway; as a result, pass holders must pay a small surcharge to cover passage through this section of tracks.
Nikkō and Shimoda (at the southern tip of the Izu Peninsula) are two other popular destinations where special rules and/or additional costs apply. See our guide to getting from Tokyo to Nikkō for advice on how to do this journey on a JR Pass without paying extra.
The All Japan Rail Pass can only be used by travelers entering Japan on a foreign passport with a temporary visitor visa (aka a tourist visa). Japanese nationals as well as foreign residents on any other kind of visa cannot buy one.
Not eligible? A handful of regional rail passes are available to long-term foreign residents of Japan (meaning you have a foreign passport but some other kind of visa, like a work visa). Another options is to get a Japan Bus Pass these can be used by anyone with a foreign passport!
The cost of the pass depends on the duration of the pass, the class, and how you buy it. It is cheapest to buy the pass overseas; the prices quoted below are the prices for purchasing overseas.
Validity period Standard Green Car (Business Class) Booking link 7 days¥
50,000
¥
70,000
Order via Klook or Headout 14 days¥
80,000
¥
110,000
Order via Klook or Headout 21 days¥
100,000
¥
140,000
Order via Klook or Headout*Prices were accurate as of July 1, .
The JR Pass is also available at KKday.
Important: The duration of each JR pass is the number of days from when it is first activated including that day. The passes are valid for travel on consecutive days only. There is no option to split up travel so once you activate your JR Pass, the clock starts. Choose carefully, because you wont be able to change the pass either the duration or the class after you arrive.
Yes, children aged 611 are eligible for a half-priced rail pass. Children must be no older than 11 on the day the pass is purchased.
JR Pass prices for children 611:
Validity period Standard Green Car (Business Class) Booking link 7 days¥
25,000
¥
35,000
Order via Klook or Headout 14 days¥
40,000
¥
55,000
Order via Klook or Headout 21 days¥
50,000
¥
70,000
Order via Klook or Headout*Prices were accurate as of July 1, .
The JR Pass is also available at KKday.
Children five and under ride for free on Japanese trains; however, they are not guaranteed a seat. Only pass holders can reserve seats, so if you want to guarantee a seat for your child/children under six, they will need their own (childrens) pass. Otherwise, they can sit in any unclaimed seats. If there arent any left, the child must ride on your lap.
For this reason, only one child under six per adult is allowed to ride for free on the Shinkansen. To ride for free, children should be under six on the day of travel (in case passports are checked).
JRs Green Car is equivalent to business class. All Shinkansen lines and some commuter lines have Green Cars. Some newer model Shinkansen also have Gran Class cars, which would be equivalent to first class. There is no Gran Class JR Pass.
An upgrade gives you more space: Ordinary Shinkansen cars seat three on one side of the aisle and two on the other, whereas Green Cars seat two and two across the aisle. The seats and armrests are a little bigger, and each seat has its own power point for charging. Theres also more legroom, more space for reclining, and a foot rest.
For reasons not related to actual JR policy, the Green Car is usually quieter than the regular cars.
The big downside is that there are no unreserved seat Green Cars, which means you must have a reserved seat for every leg of your journey. This does not cost extra, but it means that you cant just show up at the station and jump on whatever train pulls into the platform next.
Also most trains may have only one or at most up to three Green Cars, so there are just less seats in general to reserve. (Though of course reservations for ordinary cars tend to fill up faster anyway).
Services that MAY have no Green Cars include: Most Hikari and Kodama services on the Sanyō Shinkansen (Shin-Osaka to Hakata); some Sakura and Tsubame services on the Kyūshū Shinkansen (Hakata to Kagoshima); and all Kamome services on the Nishi Kyūshū Shinkansen.
Pro tip: Many of the bullet trains have power outlets available in front of or next to your seat, so that you can charge your and use your laptop; it just depends on whether the line youre riding runs newer or older series trains. You can also connect to free Wi-Fi on an increasing number of Shinkansen, though connection can by spotty (think: frequent tunnels). Read more about getting Wi-Fi in Japan.
We envy anyone who even gets to consider a 21-day pass! Most travelers find themselves deciding between the 7-day and the 14-day pass. What you ultimately choose obviously depends on where you plan to go and how long you plan to be in Japan.
¥
7,143
¥
10,000
14-day pass¥
5,714
¥
7,857
21-day pass¥
4,761
¥
6,666
*Prices were accurate as of July 1, .
The easiest way to stretch a 7-day JR Pass on a longer trip is to spend a few days at either the beginning or the end of your trip in Tokyo (and pay out of pocket for travel one-way to the airport). Then you could have a week to explore Kansai destinations like Kyoto and Osaka and travel onwards to Hiroshima and Miyajima via the castle town, Himeji. This is a classic first trip itinerary, returning to Tokyo on the last day of the pass.
On the other hand, with a couple more days and a 14-day pass, you could return to Tokyo via destinations such as Kanazawa, Nagano, or Takayama.
Keep in mind the difference in cost between a 7-day pass and a 14-day pass is ¥30,000 (or ¥40,000, for a Green Car pass). So dont get a 14-day pass just to cover transport to and/or from Tokyo and Narita Airport. But do get a 14-day pass if you plan to be traveling some distance from Tokyo for more than a week.
Pro tip: For ideas on where to go and what to do with your JR Pass, check out this 7-day DIY rail itinerary that takes you from Tokyo to Niigata and then down to Kansai. Also this Northern Explorer option that sees you going deep into the heart of Tōhoku and Hokkaidō.
Yes, this is possible. However the cost of two 7-day passes is the same as a 21-day pass (¥100,000).
You could also consider stacking regional rail passes, but this risks making things overly complicated. (With regional rail passes, you will need to disembark at the border of one region, cross to the next region, and then begin traveling on the next pass).
The classic Japan Rail Pass covers the whole JR rail network, offering maximum flexibility you can literally travel from Tokyo to Hokkaidō to Kagoshima and back to Tokyo if you please. (A journey that, if you bought individual tickets for, would cost more than ¥100,000.)
However, there are many other rail passes that cover travel within specific regions; for example, there are rail passes just for travel around Hokkaidō, Shikoku, or Kyūshū that are less expensive than the countrywide JR Pass. These passes dont, however, cover the cost of getting to and from Tokyo. So youd have to work out if, after factoring in that cost, youd still be saving money.
The only regional rail passes that covers travel from Tokyo are those offered by JR East. If your travel plans are limited to Tokyo and anywhere north and east of the capital, namely Tōhoku and Hokkaidō and not destinations to the west, like Kyoto then a regional rail pass from JR East might be a better choice that saves you money.
If you are planning a couple of inter-city return trips from Tokyo to places like Kyoto and Sendai, or one really long trip across the country, then the main JR Pass is worth getting.
The regular price (reserved seat during non-peak travel) for return travel between Tokyo and Kyoto is ¥28,340. Meanwhile, the regular round-trip price on the Shinkansen between Tokyo and Hiroshima alone is ¥38,880. So taking two trips like that would make the JR Pass worthwhile, even after October 1. For just a single trip, however, its probably not worth it.
If you plan to spend all of your trip in and around Tokyo (or Kansai, for that matter), then you almost certainly dont need a national JR Pass. You might want a regional JR Pass or a single-use Shinkansen ticket.
You could also look at the prices of Japans low-cost airlines (more on non-rail travel later).
While the Shinkansen may provide a better view of the country than you would get from the middle aisle of an airplane, its worth noting that large parts of the bullet train network are either underground or have sound barriers beside the tracks so you might spend most of the journey dozing. Youll still get plenty of glimpses of everyday Japan, though, and its possible to see Mount Fuji as you hurtle between Tokyo and Kyoto or Osaka (theyll announce it).
If you plan on taking the Shinkansen a lot, its a good idea to buy a rail pass. As we mentioned, the regular price for a return ticket on the Shinkansen between Tokyo and Hiroshima is around ¥38,000. Meanwhile, return journeys from Tokyo to Shin-Hakodate-Hokuto (Hakodate, in Hokkaidō) and Hakata (Fukuoka, in Kyūshū) cost the same: ¥46,860, nearly as much as a regular 7-day pass (which costs ¥50,000 from October 1).
However, if youre only making one long-distance trip, a one-way Shinkansen ticket may work out to be cheaper. Use our Shinkansen fare calculator to help you figure out the best option for your travel plans.
Heres a quick recap of the main tips:
There are currently two ways to buy a pass, both online:
For more information, please visit Russion Standard Rails.