Add some default ordering
This commit is contained in:
parent
a412fcf5d9
commit
dae4760a5b
5 changed files with 10 additions and 0 deletions
|
@ -21,6 +21,8 @@ class Card < ActiveRecord::Base
|
|||
validates :type, presence: true
|
||||
validates :awaken_type, presence: true
|
||||
|
||||
default_scope { order(:gameid) }
|
||||
|
||||
def dokkan?
|
||||
dokkan_id != nil
|
||||
end
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
class Character < ActiveRecord::Base
|
||||
validates :name, presence: true,
|
||||
uniqueness: { case_sensitive: false }
|
||||
|
||||
default_scope { order(:name) }
|
||||
end
|
||||
|
|
|
@ -3,4 +3,6 @@ class Link < ActiveRecord::Base
|
|||
|
||||
validates :name, presence: true,
|
||||
uniqueness: true
|
||||
|
||||
default_scope { order(:name) }
|
||||
end
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
class PassiveSkill < ActiveRecord::Base
|
||||
validates :name, presence: true
|
||||
validates :description, presence: true
|
||||
|
||||
default_scope { order(:name) }
|
||||
end
|
||||
|
|
|
@ -2,6 +2,8 @@ class SuperAttack < ActiveRecord::Base
|
|||
validates :name, presence: true
|
||||
validates :description, presence: true
|
||||
|
||||
default_scope { order(:name) }
|
||||
|
||||
def full
|
||||
"#{name} - #{description}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue