Commit Graph

8549 Commits

Author SHA1 Message Date
Xavier Noria
810a50dacf CHANGELOGs are now per branch
Changes in old branches needed to be manually synched in CHANGELOGs of newer ones.
This has proven to be brittle, sometimes one just forgets this manual step.
With this commit we switch to CHANGELOGs per branch. When a new major version is
cut from master, the CHANGELOGs in master start being blank.

A link to the CHANGELOG of the previous branch allows anyone interested to
follow the history.
2012-08-28 21:15:16 +02:00
kennyj
1006382655 Remove unused require. 2012-08-29 01:22:06 +09:00
kennyj
f686bc85b7 Fixes wrong test class names. 2012-08-29 01:21:43 +09:00
Philipp Weissensteiner
8102c0d9ed Change generators controller help from singular to plural example.
When running `rails generate controller --help` an example
with creating a (singular) "CreditCard" controller is
shown. The convention is to generate controllers with plural
names though.
2012-08-28 14:01:20 +02:00
Prem Sichanugrist
1807384c96 Raise more helpful error message on missing gem
Tell people to install `activerecord-session_store` gem when it's not
installed instead ofraising `NameError` on missing
`ActionDispatch::Session::ActiveRecordStore`.
2012-08-24 17:05:14 -04:00
Prem Sichanugrist
19a3eda011 Remove meta Sesion Migration generator 2012-08-24 16:03:15 -04:00
Prem Sichanugrist
0ffe19056c Extract ActiveRecord::SessionStore from Rails
This functionality will be available from gem
`active_record-session_store` instead.
2012-08-24 15:24:19 -04:00
José Valim
e8eb68c19a Fix failure on middleware/exceptions_test
The reason the test was failing was because when the test
invokes `app.config`, the app is loaded and, as `eager_load`
is set to true, it disables the dependency loading mechanism,
so controllers that are later defined are not loaded.
2012-08-23 10:24:19 -03:00
Rafael Mendonça França
16fbe6f3e3 Update the ducumentation about the before_eager_load callback [ci skip] 2012-08-22 22:12:24 -03:00
Rafael Mendonça França
7f1dc4ad45 before_eager_load only runs when eager_load is true 2012-08-22 22:05:52 -03:00
Vijay Dev
79e880f7f4 edit secret token template comment [ci skip] 2012-08-23 01:07:35 +05:30
Teng Siong Ong
0d809f6129 remind user a good way to generate a secret code. 2012-08-21 20:37:58 -07:00
Carlos Antonio da Silva
973b278598 Remove app building setup/teardown for remote ip railtie tests
These tests rely on "make_basic_app", which is a faster version that
does not need to create the whole app directory structure.
2012-08-21 17:37:52 -03:00
Carlos Antonio da Silva
b85894e854 Set eager load option in "make_basic_app" for railties tests
Avoid output with config option not set when running some tests.
2012-08-21 17:36:00 -03:00
José Valim
6bef1469d2 Merge pull request #7225 from rails/eager_load
Improve eager load on Rails
2012-08-21 12:58:25 -07:00
Carlos Antonio da Silva
11e890fef8 Merge pull request #6499 from lazylester/patch-1
Clarify and correct the description for the --full option of the 
plugin_new generator. [ci skip]
2012-08-21 12:35:30 -07:00
lazylester
7f765da7a7 Clarify and correct the description for the --full option of the plugin_new generator 2012-08-21 12:22:21 -07:00
Aaron Patterson
da3d28ea33 add Rack::Lock for webrick 2012-08-21 14:47:43 -03:00
José Valim
5d416b9078 Deprecate config.threadsafe! 2012-08-21 14:47:43 -03:00
José Valim
2801786e1a Get rid of config.preload_frameworks in favor of config.eager_load_namespaces
The new option allows any Ruby namespace to be registered and set
up for eager load. We are effectively exposing the structure existing
in Rails since v3.0 for all developers in order to make their applications
thread-safe and CoW friendly.
2012-08-21 14:47:19 -03:00
José Valim
11bc3487ab Remove allow_concurrency as a flag
The flag was mainly used to add a Rack::Lock middleware to
the stack, but the only scenario the lock is desired is in
development.

If you are deploying on a not-threaded server, the Rack::Lock
does not provide any benefit since you don't have concurrent
accesses. On the other hand, if you are on a threaded server,
you don't want the lock, since it defeats the purpose of using
a threaded server.

If there is someone out there, running on a thread server
and does want a lock, it can be added to your environment
as easy as: `use Rack::Lock`
2012-08-21 14:46:12 -03:00
José Valim
e6747d87f3 Allow users to choose when to eager_load the application or not.
Previously, the eager load behavior was mostly coupled to
config.cache_classes, however this was suboptimal since in
some environments a developer may want to cache classes but
not necessarily load them all on boot (for example, test env).

This pull request also promotes the use of config.eager_load
set to true by default in production. In the majority of the
cases, this is the behavior you want since it will copy most
of your app into memory on boot (which was also the previous
behavior).

Finally, this fix a long standing Rails bug where it was
impossible to access a model in a rake task when Rails was
set as thread safe.
2012-08-21 14:46:12 -03:00
Francesco Rodriguez
bb05d99106 fix punctuation in config templates 2012-08-20 11:57:16 -05:00
Miguel Herranz
31735bd391
Update to activerecord-deprecated_finders on generator 2012-08-17 21:20:20 +02:00
Vijay Dev
176f0888d8 Merge branch 'master' of github.com:lifo/docrails 2012-08-16 00:07:17 +05:30
Vijay Dev
62499bcb9d copy edits [ci skip] 2012-08-16 00:05:47 +05:30
Steve Klabnik
4c8fba11d7 We don't need to require AS::TestCase
This was only needed due to
6591a10b1f/railties/lib/rails/console_app.rb (L6)

We don't need that on master.

Fixes #6907.
2012-08-14 10:01:06 -07:00
Aaron Patterson
fa736e69a1 oops, should be directory 2012-08-13 17:15:20 -04:00
Aaron Patterson
621e079290 speed up cache directory creation
Let Rake control the cache directories.  If the directory already
exists, rake will skip creating it (vs the previous task which would
always try to mkdir_p)
2012-08-13 13:28:03 -04:00
Guillermo Iguaran
c347236ce9 Move AD default_headers configurations to railtie
ActionDispatch railtie is a better place for
config.action_dispatch.default_headers settings, users can continue
overriding those settings in their configuration files if needed.
2012-08-10 21:11:56 -05:00
Piotr Sarnacki
5b3bb61f3f Fix handling SCRIPT_NAME from within mounted engine's
When you mount your application at a path, for example /myapp, server
should set SCRIPT_NAME to /myapp. With such information, rails
application knows that it's mounted at /myapp path and it should generate
routes relative to that path.

Before this patch, rails handled SCRIPT_NAME correctly only for regular
apps, but it failed to do it for mounted engines. The solution was to
hardcode default_url_options[:script_name], which is not the best answer
- it will work only when application is mounted at a fixed path.

This patch fixes the situation by respecting original value of
SCRIPT_NAME when generating application's routes from engine and the
other way round - when you generate engine's routes from application.

This is done by using one of 2 pieces of information in env - current
SCRIPT_NAME or SCRIPT_NAME for a corresponding router. This is because
we have 2 cases to handle:

- generating engine's route from application: in this situation
  SCRIPT_NAME is basically SCRIPT_NAME set by the server and it
  indicates the place where application is mounted, so we can just pass
  it as :original_script_name in url_options. :original_script_name is
  used because if we use :script_name, router will ignore generating
  prefix for engine

- generating application's route from engine: in this situation we
  already lost information about the SCRIPT_NAME that server used. For
  example if application is mounted at /myapp and engine is mounted at
  /blog, at this point SCRIPT_NAME is equal /myapp/blog. Because of that
  we need to keep reference to /myapp SCRIPT_NAME by binding it to the
  current router. Later on we can extract it and use when generating url

Please note that starting from now you *should not* use
default_url_options[:script_name] explicitly if your server already
passes correct SCRIPT_NAME to rack env.

(closes #6933)
2012-08-11 00:21:46 +02:00
Jon Leighton
09d2671cb6 remove some artifacts of dependent_restrict_raises that I missed 2012-08-10 18:12:26 +01:00
Jon Leighton
5ad79989ef Remove the dependent_restrict_raises option.
It's not really a good idea to have this as a global config option. We
should allow people to specify the behaviour per association.

There will now be two new values:

* :dependent => :restrict_with_exception implements the current
  behaviour of :restrict. :restrict itself is deprecated in favour of
  :restrict_with_exception.
* :dependent => :restrict_with_error implements the new behaviour - it
  adds an error to the owner if there are dependent records present

See #4727 for the original discussion of this.
2012-08-10 17:45:06 +01:00
Egor Homakov
2a290f7f7c introduce default_headers config 2012-08-09 16:45:30 +03:00
David Heinemeier Hansson
ec923abe56 Remove highly uncommon option for moving the manifest path 2012-08-08 16:42:50 -05:00
David Heinemeier Hansson
775ddf2e69 Observers are no longer important enough to get this configuration option called out at the top level 2012-08-07 18:11:42 -05:00
Aaron Patterson
481dac9ec0 make assertions easier to track down 2012-08-07 10:54:47 -07:00
David Heinemeier Hansson
fb883318c8 Revert "The application generator generates public/humans.txt with some basic data". I dont consider this something most people is going to want most of the time. If you want to add it in your own app, knock yourself out. But it doesnt belong in Rails imo 2012-08-07 11:18:00 -05:00
Xavier Noria
447b6a4e67 removes usage of Object#in? from the code base (the method remains defined by Active Support)
Selecting which key extensions to include in active_support/rails
made apparent the systematic usage of Object#in? in the code base.
After some discussion in

    5ea6b0df9a

we decided to remove it and use plain Ruby, which seems enough
for this particular idiom.

In this commit the refactor has been made case by case. Sometimes
include? is the natural alternative, others a simple || is the
way you actually spell the condition in your head, others a case
statement seems more appropriate. I have chosen the one I liked
the most in each case.
2012-08-06 00:30:02 +02:00
Steve Klabnik
957e3d4966 Add extra documentation to the locale file. 2012-08-04 14:42:56 -04:00
Rafael Mendonça França
9abf589051 Remove :rails_env task since it is not needed anymore. 2012-08-02 19:41:55 -03:00
Rafael Mendonça França
d87524773d Fix tests.
Since b6ab4417720e03f1551abda2f1e4bd0a392dd04e the single quotes are
being escaped in the templates.
2012-08-02 16:04:49 -03:00
kennyj
e35c67ae0f The use_schema_cache_dump configuration moved to ActiveRecord. 2012-08-02 00:47:54 +09:00
Justin Mazzi
083ddec719 Restoring documentation for env_config per #7070 2012-08-01 08:45:25 -04:00
Aaron Cruz
a725585e35 Updated scaffold_controller generator docs #7146
It was just a copy of the controller generator documentation which was
misleading.  It doesn't accept arguments for views.  This seems more
descriptive as well.

Respect 80 char limit. #7147

Made a nicer paragraph #7147
2012-07-31 23:13:54 -03:00
David Celis
7db0b073fe Make ActiveSupport::Inflector locale aware and multilingual
The Inflector is currently not very supportive of internationalized
websites. If a user wants to singularize and/or pluralize words based on
any locale other than English, they must define each case in locale
files. Rather than create large locale files with mappings between
singular and plural words, why not allow the Inflector to accept a
locale?

This patch makes ActiveSupport::Inflector locale aware and uses `:en`` unless
otherwise specified. Users will still be provided a list of English (:en)
inflections, but they may additionally define inflection rules for other
locales. Each list is kept separately and permanently. There is no reason to
limit users to one list of inflections:

    ActiveSupport::Inflector.inflections(:es) do |inflect|
      inflect.plural(/$/, 's')
      inflect.plural(/([^aeéiou])$/i, '\1es')
      inflect.plural(/([aeiou]s)$/i, '\1')
      inflect.plural(/z$/i, 'ces')
      inflect.plural(/á([sn])$/i, 'a\1es')
      inflect.plural(/é([sn])$/i, 'e\1es')
      inflect.plural(/í([sn])$/i, 'i\1es')
      inflect.plural(/ó([sn])$/i, 'o\1es')
      inflect.plural(/ú([sn])$/i, 'u\1es')

      inflect.singular(/s$/, '')
      inflect.singular(/es$/, '')

      inflect.irregular('el', 'los')
    end

    'ley'.pluralize(:es)   # => "leyes"
    'ley'.pluralize(:en)   # => "leys"
    'avión'.pluralize(:es) # => "aviones"
    'avión'.pluralize(:en) # => "avións"

A multilingual Inflector should be of use to anybody that is tasked with
internationalizing their Rails application.

Signed-off-by: David Celis <david@davidcelis.com>
2012-07-30 21:49:18 -07:00
Rafael Mendonça França
66b859bd9e Merge pull request #6991 from frodsan/performance_test_generator
update performance test template to use test method
2012-07-24 10:40:23 -07:00
Santiago Pastorino
449039a86d Remove ActionDispatch::Head middleware in favor of Rack::Head
Closes #7110 there's more work to do on rack-cache issue 69
2012-07-23 14:34:13 -03:00
Rafael Mendonça França
b4ef4d70be Copy-edits at Rails::Queueing documentation 2012-07-21 14:02:52 -03:00
Aaron Patterson
3b3ca13307 adding Rails::Queueing::Container
This allows us to do:

In your configuration:
Rails.queue[:image_queue] = SomeQueue.new
Rails.queue[:mail_queue]  = SomeQueue.new

In your app code:
Rails.queue[:mail_queue].push MailJob.new

Both jobs pushed to the same default queue
Rails.queue.push DefaultJob.new
Rails.queue[:default].push DefaultJob.new
2012-07-19 12:09:39 -07:00