1
0
Fork 0

Add some default ordering

This commit is contained in:
Andrew Tomaka 2015-10-08 13:08:45 -04:00
parent a412fcf5d9
commit dae4760a5b
5 changed files with 10 additions and 0 deletions

View file

@ -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

View file

@ -1,4 +1,6 @@
class Character < ActiveRecord::Base
validates :name, presence: true,
uniqueness: { case_sensitive: false }
default_scope { order(:name) }
end

View file

@ -3,4 +3,6 @@ class Link < ActiveRecord::Base
validates :name, presence: true,
uniqueness: true
default_scope { order(:name) }
end

View file

@ -1,4 +1,6 @@
class PassiveSkill < ActiveRecord::Base
validates :name, presence: true
validates :description, presence: true
default_scope { order(:name) }
end

View file

@ -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