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 :type, presence: true
|
||||||
validates :awaken_type, presence: true
|
validates :awaken_type, presence: true
|
||||||
|
|
||||||
|
default_scope { order(:gameid) }
|
||||||
|
|
||||||
def dokkan?
|
def dokkan?
|
||||||
dokkan_id != nil
|
dokkan_id != nil
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
class Character < ActiveRecord::Base
|
class Character < ActiveRecord::Base
|
||||||
validates :name, presence: true,
|
validates :name, presence: true,
|
||||||
uniqueness: { case_sensitive: false }
|
uniqueness: { case_sensitive: false }
|
||||||
|
|
||||||
|
default_scope { order(:name) }
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,4 +3,6 @@ class Link < ActiveRecord::Base
|
||||||
|
|
||||||
validates :name, presence: true,
|
validates :name, presence: true,
|
||||||
uniqueness: true
|
uniqueness: true
|
||||||
|
|
||||||
|
default_scope { order(:name) }
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
class PassiveSkill < ActiveRecord::Base
|
class PassiveSkill < ActiveRecord::Base
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
validates :description, presence: true
|
validates :description, presence: true
|
||||||
|
|
||||||
|
default_scope { order(:name) }
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,8 @@ class SuperAttack < ActiveRecord::Base
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
validates :description, presence: true
|
validates :description, presence: true
|
||||||
|
|
||||||
|
default_scope { order(:name) }
|
||||||
|
|
||||||
def full
|
def full
|
||||||
"#{name} - #{description}"
|
"#{name} - #{description}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue