Commit Graph

18799 Commits

Author SHA1 Message Date
Aaron Patterson
dfa331ae15 use a method that actually exists 2010-10-01 17:54:50 -07:00
Aaron Patterson
61e8b23fe5 speed up index_by by removing a lolinject 2010-10-01 17:37:34 -07:00
Aaron Patterson
ff2fdcc52b removing AS::Testing::Default in favor of just undefing default_test 2010-10-01 17:22:42 -07:00
Xavier Noria
542ddd8c89 brings csrf_meta_tags back to the generated layout
After more discussion, it has be agreed that this kind
of changes within reasonable margins are OK for 3.1.
That is, it is fine to change a little bit the generators
even if that means examples in existing books won't be
exact. (Note that the singular csrf_meta_tag exists as an
alias and thus those outdated examples will run, same for
existing applications.)
2010-10-02 00:10:32 +02:00
Aaron Patterson
45edeed1ee Arel::Sql::Engine.new does not do anything anymore 2010-09-30 16:28:12 -07:00
Aaron Patterson
0238228e5d type_name should check for blank because people may have messed up databases 2010-09-30 16:03:05 -07:00
Aaron Patterson
15419a5dc6 build_where should be private 2010-09-30 14:37:09 -07:00
Aaron Patterson
fb4ee9c7e5 type_name is never a blank string, so use faster .nil? call 2010-09-30 14:37:04 -07:00
Marcelo Giorgi
ef6df93a8d AssociationCollection#include? working properly for objects added with build method [#3472 state:resolved] 2010-09-30 12:13:52 -07:00
Aaron Patterson
505b532605 speeding up object instantiation by eliminating instance_eval 2010-09-30 12:13:12 -07:00
Aaron Patterson
ef8ce78ba1 changing map and include to find 2010-09-30 11:00:14 -07:00
Aaron Patterson
a8a62f87f6 [#5441 state:resolved] refactoring code to determine aggregate column 2010-09-30 10:17:38 -07:00
Aaron Patterson
cc18034c8c group clause must be more specific 2010-09-30 10:17:34 -07:00
oleg dashevskii
ab9622ee62 Tests proving #5441 2010-09-30 10:17:29 -07:00
yalab
91deff08c9 Fix 'rake db:create' is ignore encoding when using postgres [#5717 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-30 13:53:06 -03:00
Neeraj Singh
33733d5d1d no need to check for nil 2010-09-30 23:59:09 +08:00
Neeraj Singh
0495736339 assert on empty array is always true. fixing test. 2010-09-30 23:57:55 +08:00
José Valim
6a55ca346e Revert "removing crazy finalizer code until there is proof that we need it"
This reverts commit a40e3c1a96.
2010-09-30 11:41:53 +02:00
José Valim
6b248f6ea5 Add more information to comments. 2010-09-30 10:33:31 +02:00
José Valim
1ba22bcde1 Merge remote branch 'drogus/engines' 2010-09-30 10:30:58 +02:00
Piotr Sarnacki
9f569c60ad Try to guess application's directory while trying to run the server, but only if config.ru is not present in current dir 2010-09-30 10:27:55 +02:00
Piotr Sarnacki
3049e645e5 Moved Rails::RoutesReloader to Rails::Application::RoutesReloader 2010-09-30 09:47:06 +02:00
Piotr Sarnacki
6648babded Allow running generators for Engine with usage of other application.
After that commit, developers can set ENGINE_PATH in ENGINE/scripts/rails
file and load application's ./script/rails (most of the time it will be
dummy application used for testing). When running ./script/rails g it will
use application to boot up, but then it will use Engine's root and
configuration for generators.
2010-09-30 09:47:06 +02: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
Piotr Sarnacki
57aa79e6be Move routes_reloader to a class: RoutesReloader 2010-09-30 09:47:06 +02:00
Piotr Sarnacki
ec5d846ac6 Properly reload routes defined in class definition
Sometimes it's easier to define routes inside Engine or
Application class definition (e.g. one file applications). The
problem with such case is that if there is a plugin that
has config/routes.rb file, it will trigger routes reload on application.
Since routes definition for application is not in config/routes.rb
file routes_reloader will fail to reload application's routes
properly. With this commit you can pass routes definition as a block
to routes method, which will allow to properly reload it:

class MyApp::Application < Rails::Application
  routes do
    resources :users
  end
end
2010-09-30 09:47:05 +02:00
Piotr Sarnacki
22b11a41cc Allow mounting engines at '/'
Without that commit script_name always become '/', which
results in paths like //posts/1 instead of /posts/1
2010-09-30 09:47:05 +02:00
Piotr Sarnacki
74598fe7e9 Do not overwrite _railtie method on namespace while creating isolated engine or application.
In order to run Engine as standalone application, you will need
Rails::Application instance in the same namespace that engine
one. It's very important to leave _railtie bound to whatever
used "namespace" method first.
2010-09-30 09:47:05 +02:00
José Valim
69f97f4697 Use .find here as it is simpler and faster. 2010-09-30 07:25:06 +02:00
Aaron Patterson
31752f3516 avoid creating a block if possible 2010-09-29 18:32:51 -07:00
Aaron Patterson
7e057d11aa fixing regexp warnings 2010-09-29 18:23:33 -07:00
Aaron Patterson
29c32e8329 tag value can be false, so nil? check is necessary 2010-09-29 17:57:39 -07:00
Neeraj Singh
396f3a28f1 double negative is not good 2010-09-30 08:11:36 +08:00
Neeraj Singh
618407db56 another case of extra nil? check 2010-09-30 08:11:35 +08:00
Neeraj Singh
08a08d97dd no need to check for nil? 2010-09-30 08:11:35 +08:00
Neeraj Singh
692f5184c4 no need to check for nil? 2010-09-30 08:11:34 +08:00
Neeraj Singh
8efdffeda3 no need of nil check 2010-09-30 08:11:34 +08:00
Neeraj Singh
299e9f6927 no need of nil check 2010-09-29 16:43:00 -07:00
Aaron Patterson
a40e3c1a96 removing crazy finalizer code until there is proof that we need it 2010-09-29 16:40:47 -07:00
Aaron Patterson
2eef53b163 removing useless code 2010-09-29 16:17:56 -07:00
Aaron Patterson
78ac9c2be7 dry up method checking in the request object 2010-09-29 16:09:58 -07:00
Aaron Patterson
ab0d216b67 reduce function calls on Array 2010-09-29 15:43:27 -07:00
Aaron Patterson
3f88f26d1e removing more lolinject 2010-09-29 15:41:06 -07:00
Aaron Patterson
2437356cda removing lollerject 2010-09-29 15:37:38 -07:00
Aaron Patterson
e8c9cac1c3 self is implied, so remove self 2010-09-29 15:16:44 -07:00
Aaron Patterson
4d7b2ee524 dry up method missing 2010-09-29 15:07:33 -07:00
Aaron Patterson
1d9a219307 oops, missed a uniq 2010-09-29 11:53:34 -07:00
Aaron Patterson
a5f8f59081 dry up action_methods 2010-09-29 11:47:54 -07:00
Aaron Patterson
1c0be7baac fixing space error 2010-09-29 11:47:54 -07:00
Emilio Tagua
61cf11247b Use detect instead select to avoid "sh: [mysqldump]: command not found".
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-29 20:29:51 +02:00