OSDN Git Service
(root)
/
pettanr
/
pettanr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
temp
[pettanr/pettanr.git]
/
app
/
models
/
ground_picture.rb
diff --git
a/app/models/ground_picture.rb
b/app/models/ground_picture.rb
index
647bf23
..
4b4269e
100644
(file)
--- a/
app/models/ground_picture.rb
+++ b/
app/models/ground_picture.rb
@@
-1,4
+1,4
@@
-class GroundPicture <
ActiveRecord::Base
+class GroundPicture <
Pettanr::Item
include Element
include ElementInspire
belongs_to :panel
include Element
include ElementInspire
belongs_to :panel
@@
-14,13
+14,20
@@
class GroundPicture < ActiveRecord::Base
@@repeat_texts = ['repeat', 'repeat-x', 'repeat-y', 'no-repeat']
@@repeat_texts = ['repeat', 'repeat-x', 'repeat-y', 'no-repeat']
- before_validation :valid_encode
+ def self.singular
+ 'GroundPicture'
+ end
- def valid_encode
- ['caption'].each do |a|
- next if attributes[a] == nil
- raise Pettanr::BadRequest unless attributes[a].valid_encoding?
- end
+ def self.plural
+ 'GroundPictures'
+ end
+
+ def self.owner_type
+ :author
+ end
+
+ def self.valid_encode_columns
+ super.merge ['caption']
end
def self.list_opt_for_panel
end
def self.list_opt_for_panel