mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Loading the Routes should happen in the environments #655
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
2af41fc036
commit
e39bf10594
4 changed files with 13 additions and 4 deletions
|
@ -257,6 +257,5 @@ module ActionController
|
||||||
end
|
end
|
||||||
|
|
||||||
Routes = RouteSet.new
|
Routes = RouteSet.new
|
||||||
Routes.reload # Server will die on load if SyntaxError
|
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,5 +1,15 @@
|
||||||
*SVN*
|
*SVN*
|
||||||
|
|
||||||
|
* Added validates_each that validates each specified attribute against a block #610 [bitsweat]. Example:
|
||||||
|
|
||||||
|
class Person < ActiveRecord::Base
|
||||||
|
validates_each :first_name, :last_name do |record, attr|
|
||||||
|
record.errors.add attr, 'starts with z.' if attr[0] == ?z
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
* Added :allow_nil as an explicit option for validates_length_of, so unless that's set to true having the attribute as nil will also return an error if a range is specified as :within #610 [bitsweat]
|
||||||
|
|
||||||
* Added that validates_* now accept blocks to perform validations #618 [Tim Bates]. Example:
|
* Added that validates_* now accept blocks to perform validations #618 [Tim Bates]. Example:
|
||||||
|
|
||||||
class Person < ActiveRecord::Base
|
class Person < ActiveRecord::Base
|
||||||
|
|
|
@ -60,6 +60,6 @@ end
|
||||||
[ActionController::Base, ActionMailer::Base].each do |klass|
|
[ActionController::Base, ActionMailer::Base].each do |klass|
|
||||||
klass.template_root ||= "#{RAILS_ROOT}/app/views/"
|
klass.template_root ||= "#{RAILS_ROOT}/app/views/"
|
||||||
end
|
end
|
||||||
|
ActionController::Routing::Routes.reload
|
||||||
|
|
||||||
# Include your app's configuration here:
|
# Include your app's configuration here:
|
||||||
|
|
|
@ -56,6 +56,6 @@ end
|
||||||
[ActionController::Base, ActionMailer::Base].each do |klass|
|
[ActionController::Base, ActionMailer::Base].each do |klass|
|
||||||
klass.template_root ||= "#{RAILS_ROOT}/app/views/"
|
klass.template_root ||= "#{RAILS_ROOT}/app/views/"
|
||||||
end
|
end
|
||||||
|
ActionController::Routing::Routes.reload
|
||||||
|
|
||||||
# Include your app's configuration here:
|
# Include your app's configuration here:
|
||||||
|
|
Loading…
Reference in a new issue