OSDN Git Service

fix: element edit
[pettanr/pettanr.git] / app / models / picture.rb
index 85c68ef..901fd3b 100644 (file)
@@ -6,6 +6,7 @@ class Picture < Peta::Content
   belongs_to :system_picture
   belongs_to :artist
   has_one :resource_picture
+  has_one :resource_picture_pictures
   
   validates :original_picture_id, :presence => true, :numericality => true, :existence => {:both => false}
   validates :revision, :presence => true, :numericality => true
@@ -17,8 +18,7 @@ class Picture < Peta::Content
   validates :license_id, :presence => true, :numericality => true, :existence => {:both => false}
   validates :system_picture_id, :presence => true, :numericality => true, :existence => {:both => false}
   validates :artist_id, :presence => true, :numericality => true, :existence => {:both => false}
-  validates :artist_name, :presence => true
-  validates :license_group_classname, :presence => true, :length => {:maximum => 50}
+  validates :license_group_module_name, :presence => true, :length => {:maximum => 50}
   
   def supply_default
   end
@@ -27,8 +27,8 @@ class Picture < Peta::Content
     attr = {:width => rp.width, :height => rp.height, :ext => rp.ext, :filesize => rp.filesize, 
       :original_picture_id => rp.original_picture_id, :license_id => rp.license_id, 
       :system_picture_id => rp.system_picture_id, :artist_id => rp.artist_id, 
-      :md5 => rp.md5, :artist_name => rp.artist_name, 
-      :license_group_classname => rp.license_group_classname, 
+      :md5 => rp.md5, 
+      :license_group_module_name => rp.license_group_module_name, 
       :license_group_settings => rp.license_group_settings, 
       :credit_picture_settings => rp.credit_picture_settings,
       :license_settings => rp.license_settings
@@ -212,11 +212,11 @@ class Picture < Peta::Content
   end
   
   def credit_template
-    "#{self.license_group_classname.tableize}/attributes/credit"
+    "#{self.license_group_module_name.tableize}/attributes/credit"
   end
   
   def full_credit_template
-    "#{self.license_group_classname.tableize}/attributes/full_credit"
+    "#{self.license_group_module_name.tableize}/attributes/full_credit"
   end
   
 end