Skip to content
This repository was archived by the owner on Dec 5, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models/captioned_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ class CaptionedImage < ActiveRecord::Base
attr_accessible :source_image_id, :text_bottom, :text_top, :title
belongs_to :source_image
delegate :adoption_info_url, to: :source_image
validates :title, :text_top, :text_bottom, allow_blank: true, format: {
with: %r{\A[A-Za-z0-9 _-?!]\Z},
message: 'Only letters, numbers, underscores, hyphens, question marks, and exclamation marks are allowed.'
}

def image_url
SimpleMemeCaptainClient.captioned_image_url(u: source_image.url,
Expand Down