Sha256: f7ea7e732f0013adf266c154c7c3c6ec47a46c58cbde2ea066b7c0b55855787d

Contents?: true

Size: 910 Bytes

Versions: 12

Compression:

Stored size: 910 Bytes

Contents

class EssenceText < ActiveRecord::Base

  acts_as_essence
  
  # Require acts_as_ferret only if Ferret full text search is enabled (default).
  # You can disable it in +config/alchemy/config.yml+
  if Alchemy::Config.get(:ferret) == true
    require 'acts_as_ferret'
    acts_as_ferret(
      :fields => {
        :body => {:store => :yes}
      },
      :remote => false
    )
    before_save :check_ferret_indexing
  end

  # Saves the content from params
  def save_ingredient(params, options = {})
    return true if params.blank?
    self.body = params["body"]
    self.link = params["link"]
    self.link_title = params["link_title"]
    self.link_class_name = params["link_class_name"]
    self.link_target = params["link_target"]
    self.public = options[:public]
    self.save
  end

private

  def check_ferret_indexing
    if self.do_not_index
      self.disable_ferret(:always)
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
alchemy_cms-2.0.7 app/models/essence_text.rb
alchemy_cms-2.0.6.1 app/models/essence_text.rb
alchemy_cms-2.0.5 app/models/essence_text.rb
alchemy_cms-2.0.4 app/models/essence_text.rb
alchemy_cms-2.0.3.1 app/models/essence_text.rb
alchemy_cms-2.1.beta1 app/models/essence_text.rb
alchemy_cms-2.0.3 app/models/essence_text.rb
alchemy_cms-2.0.2 app/models/essence_text.rb
alchemy_cms-2.0.1 app/models/essence_text.rb
alchemy_cms-2.0 app/models/essence_text.rb
alchemy_cms-2.0.rc6 app/models/essence_text.rb
alchemy_cms-2.0.rc5 app/models/essence_text.rb