Commit Graph

1414 Commits

Author SHA1 Message Date
Carlos Antonio da Silva
570cc89bad Generate special controller and functional test templates for http apps
The main goal is to not generate the format.html block in scaffold
controller, and to generate a different functional test as we don't rely
on redirects anymore, we should test for http responses.

In addition to that, the :edit action is removed from the http
controller and the edit route is not generated by default, as they
usually do not make sense in this scenario.

[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-14 12:46:25 -03:00
Carlos Antonio da Silva
3e138df977 Rename http-only app generator option to http
[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-14 12:46:24 -03:00
Carlos Antonio da Silva
7f3847cc14 Add test to ensure setting config.generators.http_only actually disables the generator options
[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-14 12:46:24 -03:00
Carlos Antonio da Silva
ff8e9e07b4 Allow generator configs from http_only! to be overriden by app
[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-14 12:46:24 -03:00
Carlos Antonio da Silva
2b355757d5 Remove duplicated tests from shared generator
[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-14 12:46:24 -03:00
Carlos Antonio da Silva
219ff43639 Disable template, helper and assets options when using http_only!
[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-14 12:46:24 -03:00
Carlos Antonio da Silva
c825e9a5ea Create generators http_only! setup and hide some common namespaces for now
[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-14 12:46:24 -03:00
Carlos Antonio da Silva
124838b508 Generate middleware http_only! config when running http only app generator
[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-14 12:46:23 -03:00
Carlos Antonio da Silva
5c8c7ca2f9 Add http-only option to Rails app generator
Change application controller template accordingly, to inherit from
ActionController::HTTP and not generate protect_from_forgery call.

[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-14 12:46:23 -03:00
Santiago Pastorino
4c16791f35 Add ActionController::HTTP
More info http://edgeguides.rubyonrails.org/api_app.html

[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-14 12:46:23 -03:00
Carlos Antonio da Silva
a8dd21d8b4 Remove IdentityMap 2012-03-13 20:08:54 -03:00
Guillermo Iguaran
e8296a0288 The sprockets railtie was moved to sprockets/rails/railtie 2012-03-13 18:06:02 -05:00
José Valim
2d3550c4be Merge pull request #5415 from rafaelfranca/refactor
Refactor the test_unit scaffold generator to use the key_value method
2012-03-13 14:20:43 -07:00
José Valim
ae67a63fe9 Merge pull request #572 from sikachu/remove_activeresource
Remove Active Resource source files from the repository.
2012-03-13 14:04:03 -07:00
Piotr Sarnacki
52bfb48745 Environment in engines tests is required on boot_rails, no need to require explicitly 2012-03-13 21:01:45 +01:00
Piotr Sarnacki
5e754a0a98 Don't need to share engine's tests anymore, plugins are gone 2012-03-13 21:01:44 +01:00
Piotr Sarnacki
24e00e1eb7 Ensure that engine can be mounted at root (#4314)
It's already fixed and the fix was actually in journey library,
but with #4314 it reappeared second time, so probably this
kind of integration test will be good to have to not allow it to
sneak in after changes in journey or rails itself.
2012-03-13 21:01:44 +01:00
Prem Sichanugrist
f1637bf2bb Remove Active Resource source files from the repository
Dear Active Resource,

It's not that I hate you or anything, but you didn't get much attention lately. There're so many alternatives out there, and I think people have made their choice to use them than you. I think it's time for you to have a big rest, peacefully in this Git repository.

I will miss you,

@sikachu.
2012-03-13 14:55:44 -04:00
Rafael Mendonça França
7c00cde79f Refactor the test_unit scaffold generator to use the key_value method 2012-03-13 14:19:03 -03:00
Rafael Mendonça França
08db3d5af3 Use the attributes hash explicitly 2012-03-13 11:21:29 -03:00
Rafael Mendonça França
7ad4c7c881 Do not use the attributes hash in the scaffold functional tests 2012-03-12 19:45:01 -03:00
Michael Koziarski
411a826583 Merge pull request #5326 from lest/patch-2
configure how unverified request will be handled
2012-03-10 16:16:35 -08:00
Santiago Pastorino
147c20b629 Fix broken tests 2012-03-10 19:15:29 -02:00
Carlos Antonio da Silva
ec40f6cec0 Change api_only to http_only
[Carlos Antonio da Silva & Santiago Pastorino]
2012-03-10 10:15:35 -03:00
Sergey Nartimov
245941101b configure how unverified request will be handled
can be configured using `:with` option in `protect_from_forgery` method
or `request_forgery_protection_method` config option

possible values:
- :reset_session (default)
- :exception

new applications are generated with:

    protect_from_forgery :with => :exception
2012-03-09 19:33:06 +03:00
Carlos Antonio da Silva
73e8e70066 Use one system call whenever possible, group rake and Dir.chdir calls 2012-03-08 19:57:17 -03:00
Aaron Patterson
447ecb08ca Merge pull request #5162 from kennyj/schema_cache_dump
[Proposal] Schema cache dump
2012-03-07 16:44:50 -08:00
kennyj
f2b048529b Revert table_name= needs connection now, so just stub table_name 2012-03-07 02:37:40 +09:00
Carlos Antonio da Silva and Santiago Pastorino
c84d3276de Add config.middleware.api_only! 2012-03-05 17:49:55 -02:00
Rafael Mendonça França
6dd6816ce3 Now all the models need to explicitly declare the accessible attributes 2012-03-04 22:17:42 -03:00
Rafael Mendonça França
5afb2f7b40 Only add the whitelist_attributes option if ActiveRecord is present 2012-03-04 21:02:28 -03:00
Michael Koziarski
641a4f6240 Whitelist all attribute assignment by default.
Change the default for newly generated applications to whitelist all attribute assignment.  Also update the generated model classes so users are reminded of the importance of attr_accessible.
2012-03-05 11:25:25 +13:00
Piotr Sarnacki
c8f6025fd3 Fix tests, table_name= needs connection now, so just stub table_name 2012-03-04 22:59:40 +01:00
Piotr Sarnacki
55dd060347 Handle files from ActionDispatch::Static with Rack::Sendfile (fixes #5225)
This makes rails behave properly when you serve static assets
and you have X-Sendfile headers enabled. Nevertheless in most
cases you should not rely on that and serve static assets with
a webserver like Apache or Nginx (as you already have it in
place anyway if you use X-Sendfile)
2012-03-03 20:46:56 +01:00
kennyj
5cbba30a12 Support judgement expired schema cache dump. 2012-03-01 01:19:27 +09:00
kennyj
0da12df260 Load db/schema_cache.dump duaring boot time. 2012-03-01 01:13:14 +09:00
kennyj
0150a212c0 Add db:schema:cache:dump and db:schema:cache:clear tasks. 2012-03-01 01:01:12 +09:00
Arun Agrawal
d03076f206 put and patch both are allowed for update 2012-02-25 09:40:50 +05:30
Xavier Noria
84cd58f2ac fixes a test: rake routes now includes PATCH for resources 2012-02-24 17:21:45 -08:00
Xavier Noria
b7a094536d uses PATCH for the forms of persisted records, and routes PATCH and PUT to the update action of resources 2012-02-24 16:25:41 -08:00
David Lee
002713c645 Add config.default_method_for_update to support PATCH
PATCH is the correct HTML verb to map to the #update action. The
semantics for PATCH allows for partial updates, whereas PUT requires a
complete replacement.

Changes:
* adds config.default_method_for_update you can set to :patch
* optionally use PATCH instead of PUT in resource routes and forms
* adds the #patch verb to routes to detect PATCH requests
* adds #patch? to Request
* changes documentation and comments to indicate support for PATCH

This change maintains complete backwards compatibility by keeping :put
as the default for config.default_method_for_update.
2012-02-22 08:47:10 -08:00
Peter Mitchell
910c59fffe Correctly print names of non-timestamped migrations with db:migrate:status 2012-02-17 16:58:11 +01:00
Piotr Sarnacki
c84e4b5d4b Fix tests, Rails.env may be different on CI 2012-02-16 21:26:01 +01:00
Piotr Sarnacki
dd655d88d6 Refactor Rails::Console to make it easier to test and add tests for it 2012-02-16 20:41:35 +01:00
Bartlomiej Kozal
dd8c6f0556 Display annotations from .coffee files in rake notes 2012-02-05 16:42:35 +01:00
Carlos Antonio da Silva
c6ef45d6c4 Add convenience method to hide a generator from the available ones
It is usually useful to be able to hide a generator when running rails
generate command. Such generators might be used only to dry up
generators code and shouldn't be available to end users.
2012-02-03 10:18:58 -02:00
Rafael Mendonça França
e778e22812 Remove the dependent_restrict_raises configuration if activerecord is
not preset
2012-02-01 17:03:23 -02:00
kennyj
8afa8b0c21 Fix GH #4737. Missing helper file (LoadError) in mountable plugin. 2012-02-02 02:34:47 +09:00
kennyj
0c0e58c913 Don't run bundle install when passed with --pretend option 2012-02-01 01:13:52 +09:00
Rafael Mendonça França
25a69e2ea5 Only add ActiveRecord configuration if it is present 2012-01-31 12:41:16 -02:00