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

Version Path
alchemy_cms-2.0.7 app/models/essence_picture.rb
alchemy_cms-2.0.6.1 app/models/essence_picture.rb
alchemy_cms-2.0.5 app/models/essence_picture.rb
alchemy_cms-2.0.4 app/models/essence_picture.rb
alchemy_cms-2.0.3.1 app/models/essence_picture.rb
alchemy_cms-2.1.beta1 app/models/essence_picture.rb
alchemy_cms-2.0.3 app/models/essence_picture.rb
alchemy_cms-2.0.2 app/models/essence_picture.rb
alchemy_cms-2.0.1 app/models/essence_picture.rb
alchemy_cms-2.0 app/models/essence_picture.rb
alchemy_cms-2.0.rc6 app/models/essence_picture.rb
alchemy_cms-2.0.rc5 app/models/essence_picture.rb
alchemy_cms-2.0.rc4 app/models/essence_picture.rb
alchemy_cms-2.0.rc3 app/models/essence_picture.rb
alchemy_cms-2.0.rc2 app/models/essence_picture.rb
alchemy_cms-2.0.rc1 app/models/essence_picture.rb
alchemy_cms-2.0.pre5 app/models/essence_picture.rb
alchemy_cms-2.0.pre4 app/models/essence_picture.rb
alchemy_cms-2.0.pre3 app/models/essence_picture.rb
alchemy_cms-2.0.pre2 app/models/essence_picture.rb