Sha256: 35ae98254a36a46bc71192da0a58bb91f1dfd0a2aacc09f96b28f81b9e989709

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

class Admin::SettingsController < Admin::BaseController

  cache_sweeper :blog_sweeper

  def index
    if this_blog.base_url.blank?
      this_blog.base_url = blog_base_url
    end
  end
  
  def read; end
  def write; end
  def feedback; end
  def seo; end
  
  def redirect
    flash[:notice] = _("Please review and save the settings before continuing")
    redirect_to :action => "index"
  end

  def update
    if request.post?
      Blog.transaction do
        params[:setting].each { |k,v| this_blog.send("#{k.to_s}=", v) }
        this_blog.save
        flash[:notice] = _('config updated.')
      end
      redirect_to :action => params[:from]
    end
  end
  
  def update_database
    @current_version = Migrator.current_schema_version
    @needed_version = Migrator.max_schema_version
    @support = Migrator.db_supports_migrations?
    @needed_migrations = Migrator.available_migrations[@current_version..@needed_version].collect do |mig|
      mig.scan(/\d+\_([\w_]+)\.rb$/).flatten.first.humanize
    end
  end

  def migrate
    if request.post?
      Migrator.migrate
      redirect_to :action => 'update_database'
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
typo-5.1.98 app/controllers/admin/settings_controller.rb
typo-5.2 app/controllers/admin/settings_controller.rb