Sha256: 27e2f31753546982aaf182ba7a6f921d0a6fa569c6b631b53a472a19cb74da50
Contents?: true
Size: 607 Bytes
Versions: 20
Compression:
Stored size: 607 Bytes
Contents
class EssencePicture < ActiveRecord::Base acts_as_essence( :ingredient_column => :picture, :preview_text_method => :name ) belongs_to :picture before_save :replace_newlines def replace_newlines return nil if caption.nil? caption.gsub!(/(\r\n|\r|\n)/, "<br/>") end # Saves the ingredient def save_ingredient(params, options = {}) return true if params.blank? self.link_class_name = params['link_class_name'] self.link_target = params['link_target'] self.link = params['link'] self.link_title = params['link_title'] self.picture_id = params['picture_id'] self.save end end
Version data entries
20 entries across 20 versions & 1 rubygems