1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

32 commits

Author SHA1 Message Date
Piotr Sarnacki
cfbe595831 Use application's generators defaults as engine defaults to not force users to manually set it 2010-11-02 17:14:52 +01:00
Piotr Sarnacki
f851352318 Added config.app_generators to allow configuring application's generators from railties.
With config.generators becomes a way to configure generators
for current instance only. For example:

module Blog
  class Engine < Rails::Engine
    config.generators do |g|
      g.orm :active_record
    end

    config.app_generators do |g|
      g.test_framework :rspec
    end
  end
end

such definition sets :active_record as orm for engine and :rspec
as test_framework for application. The values set with app_generators
can be overwritten in application using config.generators as you would
normally do:

module MyApp
  class Application < Rails::Application
    config.generators do |g|
      g.test_framework :test_unit
    end
  end
end
2010-09-30 09:47:06 +02:00
Jeremy Kemper
c211d904ba Revert "Just add connection management middleware if running in a concurrent environment."
This reverts commit 6b29dc876f.
2010-08-20 18:55:02 -07:00
José Valim
fa98eca75b Add console hook to force ActiveRecord::Base to be loaded when console starts avoiding reference loops. 2010-07-18 11:02:07 +02:00
José Valim
6b29dc876f Just add connection management middleware if running in a concurrent environment. 2010-07-12 20:18:54 +02:00
José Valim
6788db824a Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [#4816 state:resolved] 2010-06-24 13:23:43 +02:00
Xavier Noria
207fa59675 Merge remote branch 'rails/master'
Conflicts:
	actionpack/lib/abstract_controller/base.rb
2010-06-20 23:13:19 +02:00
José Valim
312f433241 Clear DescendantsTracker on each request. 2010-06-19 17:51:44 +02:00
Rizwan Reza
2b7f08428c Adds basic description and title. 2010-06-16 22:15:04 +04:30
wycats
9cfeefb637 Reorganized initializers a bit to enable better hooks for common cases without the need for Railtie. Specifically, the following hooks were added:
* before_configuration: this hook is run immediately after the Application class 
  comes into existence, but before the user has added any configuration. This is
  the appropriate place to set configuration for your plugin
* before_initialize: This is run after all of the user's configuration has completed,
  but before any initializers have begun (in other words, it runs right after
  config/environments/{development,production,test}.rb)
* after_initialize: This is run after all of the initializers have run. It is an
  appropriate place for forking in a preforking setup

Each of these hooks may be used via ActiveSupport.on_load(name) { }. In all these cases, the context inside the block will be the Application object. This means that for simple cases, you can use these hooks without needing to create a Railtie.
2010-05-15 06:09:07 -07:00
José Valim
3dfcb56e45 ActiveRecord middlewares should be inserted before AD::Cascade [#4493 state:resolved]. 2010-04-29 13:24:35 +02:00
José Valim
2e3d903e1b Move observers initialization to after_config blocks, they are still being initialized to early (before load paths are being set). 2010-04-20 21:19:48 +02:00
Michael Koziarski
5aa58cc03f Split the observer railtie into two phases.
Observers observing models with scopes defined will require the connection to be established.
2010-04-16 09:49:06 +12:00
wycats
4aded43b73 Replace the placeholder base_hook API with on_load. To specify some code that
should run during framework load do:

ActiveSupport.on_load(:action_controller) do
  # Code run in the context of AC::Base
end
2010-03-29 17:08:50 -07:00
José Valim
395d6648ce Move application configuration to the application configuration object, remove railtie_name and engine_name and allow to set the configuration object. 2010-03-26 18:47:55 +01:00
wycats
39d6f9e112 Make many parts of Rails lazy. In order to facilitate this,
add lazy_load_hooks.rb, which allows us to declare code that
should be run at some later time. For instance, this allows
us to defer requiring ActiveRecord::Base at boot time purely
to apply configuration. Instead, we register a hook that should
apply configuration once ActiveRecord::Base is loaded.

With these changes, brings down total boot time of a
new app to 300ms in production and 400ms in dev.

TODO: rename base_hook
2010-03-07 06:24:30 -08:00
Prem Sichanugrist
f0523f72b4 Rename Rails::Subscriber to Rails::LogSubscriber 2010-02-16 22:36:15 +01:00
Jeremy Kemper
23ad1eff0d Rationalize railtie dependencies: AC uses AV; AR uses AMo; and Rails always uses AS. 2010-02-04 10:08:06 -08:00
José Valim
d6e2f5013c Drop AR I18n deprecation and simple use errors.messages as fallback. 2010-01-30 13:12:12 +01:00
Paul Rosania
766e857bea tsort-based dependency resolution for initializers
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-01-29 19:25:58 -08:00
Carl Lerche
f15bbcf97e Move the ActiveRecord generator settings into the Railtie 2010-01-28 10:45:25 -08:00
José Valim
02908e1142 As first step setup the load path and lazy compare middlewares. 2010-01-25 22:59:08 +01:00
José Valim
3b6f659fb6 Add active_model/railtie back to generated boot.rb, add models back to paths, load active_support/railtie since we need it and ensure default logger is set before config. 2010-01-25 01:12:22 +01:00
José Valim
e548f96b1d Rename plugin_name to railtie_name and engine_name. 2010-01-24 12:23:21 +01:00
José Valim
c8cc8a9872 Moved more configuration away from bootstrap. 2010-01-22 20:44:38 +01:00
José Valim
8c8942ed4f Move Dispatcher setup to Railties and add instrumentation hook. 2010-01-15 12:24:30 +01:00
José Valim
dc2e291a93 Move AR logging responsibilities to ActiveRecord::Railties::Subscriber. 2010-01-13 01:19:23 +01:00
José Valim
c1239e6509 Send the connection in AR notifications to avoid checking out new connections in threads just for logging purposes. 2010-01-11 15:14:52 +01:00
José Valim
821a160a49 Add a deprecation message to activerecord.errors. 2010-01-07 15:31:49 +01:00
José Valim
3990310a2b Use underscore in notification namespaces. 2010-01-04 00:03:56 +01:00
José Valim
6fbe9ef2ff Use namespaces in notifications. 2010-01-03 20:39:42 +01:00
Carl Lerche
ae7ada1fde Some railties cleanup:
* Rename <framework>/rails.rb -> <framework>/railtie.rb
	* Rails::Plugin -> Rails::Railtie
	* Rails::Plugin::Vendored -> Rails::Plugin
2009-12-31 13:12:52 -08:00
Renamed from activerecord/lib/active_record/rails.rb (Browse further)