validates :title, :presence => true, :length => {:maximum => 100}
validates :visible, :presence => true, :numericality => true, :inclusion => {:in => 0..1}
+ validates :author_id, :presence => true, :numericality => true, :existence => {:both => false}
+
before_validation :valid_encode
def valid_encode