1
0
Fork 0
dokkan-data-rails/app/models/super_attack.rb

18 lines
356 B
Ruby
Raw Permalink Normal View History

2015-10-06 13:55:12 -04:00
class SuperAttack < ActiveRecord::Base
has_paper_trail
2015-10-06 13:55:12 -04:00
validates :name, presence: true
validates :description, presence: true,
uniqueness: { scope: :name }
2015-10-08 13:02:25 -04:00
2015-10-08 13:08:45 -04:00
default_scope { order(:name) }
2015-10-08 13:02:25 -04:00
def full
"#{name} - #{description}"
end
2015-11-03 16:15:20 -05:00
def self.issues
SuperAttack.where("name = '' OR description = ''")
end
2015-10-06 13:55:12 -04:00
end