Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 13
- Log:
Initial import of Typo 2.6.0 sources from a downloaded Tarball.
Typo is a Ruby On Rails based blog engine.
- Author:
- adh
- Date:
- Sat Jul 22 22:25:02 +0100 2006
- Size:
- 1101 Bytes
1 | class Admin::GeneralController < Admin::BaseController |
2 | def index |
3 | @page_cache_size = PageCache.count |
4 | end |
5 | |
6 | def update_database |
7 | @current_version = Migrator.current_schema_version |
8 | @needed_version = Migrator.max_schema_version |
9 | @support = Migrator.db_supports_migrations? |
10 | @needed_migrations = Migrator.available_migrations[@current_version..@needed_version].collect do |mig| |
11 | mig.scan(/\d+\_([\w_]+)\.rb$/).flatten.first.humanize |
12 | end |
13 | end |
14 | |
15 | def migrate |
16 | if request.post? |
17 | Migrator.migrate |
18 | redirect_to :action => 'update_database' |
19 | end |
20 | end |
21 | |
22 | def update |
23 | if request.post? |
24 | Setting.transaction do |
25 | for field, value in params[:setting] |
26 | setting = find_or_create(field) |
27 | setting.value = value |
28 | setting.save |
29 | end |
30 | end |
31 | flash[:notice] = 'config updated.' |
32 | redirect_to :action => 'index' |
33 | end |
34 | end |
35 | |
36 | private |
37 | |
38 | def find_or_create(name) |
39 | unless setting = Setting.find_by_name(name) |
40 | setting = Setting.new("name" => name) |
41 | end |
42 | setting |
43 | end |
44 | end |