OSDN Git Service

rails upgrade to 4 for js
[pettanr/pettanr.git] / app / models / writing_format.rb
index 850d735..ebcde00 100644 (file)
@@ -10,6 +10,14 @@ class WritingFormat < Peta::Template
   validates :system_picture_id, :presence => true, :numericality => true, :existence => {:both => false}
   validates :settings, :presence => true
   
+  scope :find_index, -> do
+    self
+  end
+  
+  scope :find_by_system_picture, -> (system_picture_id) do 
+    find_index.where(system_picture_id: system_picture_id)
+  end
+  
   def supply_default
   end