OSDN Git Service

const to method
[praisedb/praisedb.git] / app / models / song.rb
index 33a5e76..9c960c2 100644 (file)
@@ -1,9 +1,6 @@
 class Song < ActiveRecord::Base
   include ::SelectableAttr::Base
 
-  DEFAULT_FONT_SIZE = 2
-  CODES = %w(A Ab Bb C Cm D E Eb Em F F#m Fm G)
-
   selectable_attr :font_size do
     entry "0", :xsmall, 'XSmall'
     entry "1", :small, 'Small'
@@ -12,9 +9,12 @@ class Song < ActiveRecord::Base
     entry "4", :xlarge, 'XLarge'
   end
 
-# validates_presence_of :titile, :words, :font_size
-# validates_numericality_of :font_size
-  def kana
-    self.words
+  CODES = %w(A Ab Bb C Cm D E Eb Em F F#m Fm G)
+
+  validates_presence_of :titile, :words, :font_size
+  validates_numericality_of :font_size
+
+  def self.default_font_size
+    self.font_size_id_by_key(:middle)
   end
 end