Skip to content

Commit c22925b

Browse files
committed
Add scope for default order
1 parent f4d6dce commit c22925b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/models/dojo.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ class Dojo < ApplicationRecord
1111
serialize :tags
1212
before_save { self.email = self.email.downcase }
1313

14+
scope :default_order, -> { order(prefecture_id: :asc) }
15+
1416
validates :name, presence: true, length: { maximum: 50 }
1517
validates :email, presence: false
1618
validates :order, presence: false

0 commit comments

Comments
 (0)