Atualizando para o Rails 2.3.2
This commit is contained in:
@@ -6,7 +6,7 @@ App.webmaster_email = "webmaster@wikiufc.gelsol.org"
|
||||
App.default_host = "wikiufc.gelsol.org"
|
||||
App.base_path = ""
|
||||
|
||||
App.current_period = "2008.1"
|
||||
App.current_period = "2008.2"
|
||||
|
||||
# Limites
|
||||
App.max_upload_file_size = 5.megabytes
|
||||
|
||||
@@ -43,6 +43,7 @@ module Rails
|
||||
class VendorBoot < Boot
|
||||
def load_initializer
|
||||
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
||||
Rails::Initializer.run(:install_gem_spec_stubs)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -66,7 +67,7 @@ module Rails
|
||||
|
||||
class << self
|
||||
def rubygems_version
|
||||
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
|
||||
Gem::RubyGemsVersion rescue nil
|
||||
end
|
||||
|
||||
def gem_version
|
||||
@@ -81,14 +82,14 @@ module Rails
|
||||
|
||||
def load_rubygems
|
||||
require 'rubygems'
|
||||
|
||||
unless rubygems_version >= '0.9.4'
|
||||
$stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
||||
min_version = '1.3.1'
|
||||
unless rubygems_version >= min_version
|
||||
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
||||
exit 1
|
||||
end
|
||||
|
||||
rescue LoadError
|
||||
$stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
||||
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
||||
exit 1
|
||||
end
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# ENV['RAILS_ENV'] ||= 'production'
|
||||
|
||||
# Specifies gem version of Rails to use when vendor/rails is not present
|
||||
RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
|
||||
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
|
||||
|
||||
# Bootstrap the Rails environment, frameworks, and default configuration
|
||||
require File.join(File.dirname(__FILE__), 'boot')
|
||||
@@ -56,4 +56,12 @@ Rails::Initializer.run do |config|
|
||||
|
||||
# Make Active Record use UTC-base instead of local time
|
||||
config.active_record.default_timezone = :utc
|
||||
|
||||
config.gem "dr_nic_magic_models"
|
||||
config.gem "bluecloth"
|
||||
config.gem "acts_as_versioned"
|
||||
config.gem "haml"
|
||||
config.gem "hpricot"
|
||||
config.gem "icalendar"
|
||||
config.gem 'thoughtbot-shoulda', :lib => 'shoulda/rails', :source => "http://gems.github.com"
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@ config.whiny_nils = true
|
||||
# Show full error reports and disable caching
|
||||
config.action_controller.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
config.action_view.cache_template_extensions = false
|
||||
#config.action_view.cache_template_extensions = false
|
||||
config.action_view.debug_rjs = true
|
||||
|
||||
# Don't care if the mailer can't send
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
require 'hpricot'
|
||||
require 'icalendar'
|
||||
require 'tzinfo'
|
||||
#require 'assert_valid_xhtml'
|
||||
@@ -1,4 +1,4 @@
|
||||
TzTime.zone = TZInfo::Timezone.new("America/Fortaleza")
|
||||
#TzTime.zone = TZInfo::Timezone.new("America/Fortaleza")
|
||||
|
||||
class Time
|
||||
alias :strftime_nolocale :strftime
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
require "#{RAILS_ROOT}/app/models/message.rb"
|
||||
require "#{RAILS_ROOT}/app/models/log_entry.rb"
|
||||
|
||||
class Fixnum
|
||||
def is_numeric?
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
class String
|
||||
def is_numeric?
|
||||
Float self rescue false
|
||||
@@ -24,3 +30,21 @@ class Array
|
||||
self
|
||||
end
|
||||
end
|
||||
|
||||
module ActiveRecord
|
||||
module Acts
|
||||
module Versioned
|
||||
module ClassMethods
|
||||
def acts_as_paranoid_versioned
|
||||
acts_as_paranoid
|
||||
acts_as_versioned
|
||||
|
||||
# protect the versioned model
|
||||
self.versioned_class.class_eval do
|
||||
def self.delete_all(conditions = nil); return; end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -31,11 +31,13 @@ ActionController::Routing::Routes.draw do |map|
|
||||
}
|
||||
|
||||
course.resources :news,
|
||||
:singular => "news_instance",
|
||||
:member => {
|
||||
:undelete => :post
|
||||
}
|
||||
|
||||
course.resources :wiki,
|
||||
:singular => "wiki_instance",
|
||||
:member => {
|
||||
:diff => :get,
|
||||
:versions => :get,
|
||||
|
||||
Reference in New Issue
Block a user