OSDN Git Service

today's work. songs new, create, edit
[praisedb/praisedb.git] / app / models / song.rb
index 091746f..33a5e76 100644 (file)
@@ -1,2 +1,20 @@
 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'
+    entry "2", :middle, 'Middle'
+    entry "3", :large, 'Large'
+    entry "4", :xlarge, 'XLarge'
+  end
+
+# validates_presence_of :titile, :words, :font_size
+# validates_numericality_of :font_size
+  def kana
+    self.words
+  end
 end