Skip to content

Display prefecture after Dojo name (instead of region name) #381

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

Merged
merged 3 commits into from
Jan 26, 2019

Conversation

yasulab
Copy link
Member

@yasulab yasulab commented Jan 26, 2019

Fix #380

This PR changes the following 2 things:

1. Display prefecture name instead of region name:

  • Delete hard-coded region name in /db/dojos.yaml
  • Display prefecture name after Dojo name

image

2. Records in DB:

  • Change records in Prefecture model like this:
    • 北海道 -> 北海道
    • 東京都 -> 東京
    • 大阪府 -> 大阪
    • 沖縄県 -> 沖縄

@yasulab yasulab requested a review from nalabjp January 26, 2019 07:56
@yasulab
Copy link
Member Author

yasulab commented Jan 26, 2019

Will merge this PR when CI passes ✅ 👀

@yasulab
Copy link
Member Author

yasulab commented Jan 26, 2019

Locally checked that this works fine. ✅ ✨

@yasulab yasulab merged commit 57ca257 into master Jan 26, 2019
@yasulab yasulab deleted the display-dojo-prefecture branch January 26, 2019 07:59
@nalabjp
Copy link
Member

nalabjp commented Feb 19, 2019

@yasulab
Sorry for replying so late.
Why do we need this commit ac0215c ?
It seems unnecessary for the purpose of this PR.

@yasulab
Copy link
Member Author

yasulab commented Feb 19, 2019

It seems unnecessary for the purpose of this PR.

@nalabjp Yeah, I thought this not necessary, but through creating this PR I needed to update some of dojo names as noted at ## 2. Records in DB. And I found this changed the order of dojo listing. So I put this code to set order by ascending.

But what I care about is the order and result, so if the order and result is same as now, I'm not against to deleting this code. ;)

@nalabjp
Copy link
Member

nalabjp commented Feb 20, 2019

@yasulab
Thank you for your easy explanation.
I believe that orders in prefectures are already collateralized.
That's because Dojo.default_order scope is applied to the return value of the following code.

@regions_and_dojos = Dojo.group_by_region_on_active

scope :default_order, -> { order(prefecture_id: :asc, order: :asc) }

So, I think that Dojo' default_scope can be deleted, but what do you think?

@yasulab
Copy link
Member Author

yasulab commented Feb 20, 2019

@nalabjp Thanks for explaining code by code. 🆒✨ I have deleted the line in this commit. ;) ff6a548

@nalabjp
Copy link
Member

nalabjp commented Feb 20, 2019

Thank you for your commit 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants