Skip to content

Commit 57ca257

Browse files
authored
Merge pull request #381 from coderdojo-japan/display-dojo-prefecture
Display prefecture after Dojo name (instead of region name)
2 parents b1dbd59 + e367597 commit 57ca257

File tree

3 files changed

+175
-174
lines changed

3 files changed

+175
-174
lines changed

app/models/prefecture.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
class Prefecture < ApplicationRecord
2+
default_scope -> { order(id: :asc) }
23
validates :name, presence: true, uniqueness: true
34
validates :region, presence: true
45
end

app/views/shared/_dojo.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%header
33
%a{:href => "#{dojo.url}"}
44
%span.dojo-picture{:style => "background-image: url(#{dojo.logo});"}
5-
%span.dojo-name= dojo.name
5+
%span.dojo-name= "#{dojo.name} (#{dojo.prefecture.name})"
66
%ul.tags
77
- dojo.tags.each do |tag|
88
%li= tag

0 commit comments

Comments
 (0)