on by default
Aaron 's blog post
Discusion of 's Pull Request
Improve eager load on : Pull Request
Security 's default headers
match doesn't catch all
Set escapingin encoding to true by default
Add ActiveSupport:: KeyGenerator as a simple wrapper …
…Rails :: Railtie do console do | app | Bundler .require( :console ) Wirb .start Hirb .enable end end
This creates an anonymous Railtie in which you can specify what happens when the console is started. Here you can require all your console extensions and perform additional configuration.
Railties need to be loaded before you define your Rails application, or else you're too late and the console block won't be executed.
Rails 2.3-style plugins in vendor/plugins are deprecated and will be removed in Rails 4.0. Move them out of vendor/plugins and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/ initializers/myplugin.rb. Santiago Pastorino
Allow scaffold/model/migration generators to accept a "index" and "uniq" …
Fix bug with referencing other mysql databases in set table name.3690
Fix performance bug with mysql databases on a server with lots of other databses. GH 3678
Christos Zisopoulos andJ
New apps should be generated with a sass-rails dependency of 3.1.5, not 3.1.5.rc.2
As ever, you can see a full list of changes on .
…doesn't really go into depth about what you can use Railties to do. Here are some example Railties explaining how to use themethods (in alphabetical order) to customize and extend .
console The console method allows your Railtie to add code that will be run when a Rails console is started.
console do Foo.console_mode! end
generators Rails will require any generators defined in lib/generators/*.rb automatically. If you ship Rails::Generators with …
…lib/tasks and Railties instead . lib/tasks already works in Rails 2, Railties is a Rails 3 feature but you can use it in combination with the legacy init.rb file to preserve compatibility with both Rails 2 and Rails 3 versions.
Rails 3 upgrade
The steps above are not enough to make your project a real Rails 3 application, they are just a small subset of changes you should apply. The big difference which is also the main advantage compared with all the other changes, …
Some questions have come up since I posted about rspec-rails-2 generators and rake tasks requiring that rspec-rails be declared in the :development group in a . Here are a few of them, paraphrased, with answers:
Why the change?
rspec-rails now uses ato expose the rake tasks and generators. Railties allow extensions to register themselves with Rails without having to copy files into your app. This makes installation and, especially, upgrades much easier to manage for both maintainers and users.
3. Abusing modularity - In this module (ha ha!), we'll look at how to exploit Rails new modularity in fun and interesting ways. We'll build a new router, build an app without a single real controller, and other fun things that while seemingly just hacks, can actually be really useful in …
Integration award: Railties
Rails 3 has several improvements and not all of them may be visible to the application developer. One of the hidden unicorns is Railties test suite. As stated in a blog post during the refactoring of version 2.3 to 3.0:
"Although theinitializer tests covered a fair amount of area, successfully getting the tests to pass did not guarantee that Rails booted."
This happened because, in order to have fast tests, Rails…
…that right. While Rails itself ships with ActiveRecord as a default, the Railties gem, responsible for bootstrapping Rails, knows nothing about ActiveRecord. In order to achieve this, we had to make that bootstrapping process much more pluggable. While this is amazing for extensions, like DataMapper, that want to replace a built-in framework, it also exposes more functionality to any Rails extension distributed as a gem.
In short, Railties now coordinates the …