Changesets can be listed by changeset number.
The Git repository is here.
Changeset 185
Upgraded to work with Rails 1.2. Deprecation warnings
honoured, routing errors fixed.
- Comitted by: rool
- Date: Sunday March 25 20:11:16 2007 (over 17 years ago)
Affected files:
- rool/rails/i2/trunk/app/models/book.rb (diff)
- rool/rails/i2/trunk/app/models/page.rb (diff)
- rool/rails/i2/trunk/config/boot.rb (diff)
- rool/rails/i2/trunk/config/routes.rb (diff)
rool/rails/i2/trunk/app/models/book.rb:
prev. | current | |
class Book < ActiveRecord::Base | ||
2 | | |
3 | | |
2 | has_many :authors, :dependent => :destroy | |
3 | has_many :pages, :dependent => :destroy | |
has_many :versions, :order => "versions.created_at DESC" | ||
serialize :existing_page_titles, Array |
rool/rails/i2/trunk/app/models/page.rb:
prev. | current | |
class Page < ActiveRecord::Base | ||
belongs_to :book | ||
4 | | |
4 | has_many :versions, :order => "created_at", :dependent => :destroy | |
has_one :current_version, :class_name => "Version", :order => "created_at DESC" | ||
def find_or_build_version(number = nil) |
rool/rails/i2/trunk/config/boot.rb:
prev. | current | |
rails_gem = Gem.cache.search('rails', "=#{version}").first | ||
if rails_gem | ||
28 | | |
28 | gem "rails", "=#{version}" | |
require rails_gem.full_gem_path + '/lib/initializer' | ||
else | ||
STDERR.puts %(Cannot find gem for Rails =#{version}: | ||
... | ... | |
exit 1 | ||
end | ||
else | ||
38 | | |
38 | gem "rails" | |
require 'initializer' | ||
end | ||
end | ||
Rails::Initializer.run(:set_load_path) | ||
44 | ||
45 | end |
rool/rails/i2/trunk/config/routes.rb:
prev. | current | |
map.recent PATH_PREFIX + '/:book_url_name/recent', :controller => "pages", :action => "recent" | ||
map.page PATH_PREFIX + '/:book_url_name/pages/:page_title', :controller => "pages", :action => "show" | ||
map.new PATH_PREFIX + '/:book_url_name/pages/:page_title/versions/new', :controller => "versions", :action => "new" | ||
9 | | |
10 | | |
9 | map.rollback PATH_PREFIX + '/:book_url_name/pages/:page_title/versions/new/:version_number', :controller => "versions", :action => "new", :requirements => { :version_number => /\d+/ } | |
10 | map.version PATH_PREFIX + '/:book_url_name/pages/:page_title/versions/:version_number', :controller => "versions", :action => "show", :requirements => { :version_number => /\d+/ } | |
map.connect PATH_PREFIX + '/:book_url_name/pages/:page_title/:controller/:action/:id' | ||