Commit Graph

10767 Commits

Author SHA1 Message Date
Xavier Noria
92f9ff8cc3 converts hashes in arrays of unfiltered params to unpermitted params [fixes #13382] 2013-12-21 01:16:38 +01:00
Jeremy Kemper
c437a98aca Merge pull request #13188 from imanel/skip_deep_munge
Add configuration option to optionally disable deep_munge

Conflicts:
	actionpack/CHANGELOG.md
2013-12-19 23:39:17 -07:00
Vijay Dev
a3b1105ada Merge branch 'master' of github.com:lifo/docrails 2013-12-20 00:10:30 +05:30
Carlos Antonio da Silva
3b10ad0874 Fix assertions for testing unknown formats using Mime::NullType 2013-12-19 14:19:41 -02:00
Ryunosuke SATO
d54bc032c9 Show routes defined under assets prefix
Closes #9625
2013-12-19 09:51:17 -02:00
Carlos Antonio da Silva
c5b76b5362 Prefer assert_raise instead of flunk + rescue to test for exceptions
Change most tests to make use of assert_raise returning the raised
exception rather than relying on a combination of flunk + rescue to
check for exception types/messages.
2013-12-19 09:20:51 -02:00
Vipul A M
7bae2921ec Change all MiniTest to Minitest since, MiniTest namespace has been renamed to Minitest
Ref: https://github.com/seattlerb/minitest/blob/master/History.txt
2013-12-18 14:39:50 +05:30
David Heinemeier Hansson
c0a2d474c5 Get ready to release 4.1.0.beta1 2013-12-17 16:05:28 -08:00
Jeremy Kemper
4f4fdd643f Clearly limit new CSRF protection to GET requests 2013-12-17 16:02:04 -07:00
Jeremy Kemper
39ca25f5c4 Merge pull request #13345 from jeremy/get-csrf
CSRF protection from cross-origin <script> tags
2013-12-17 12:29:57 -08:00
Jeremy Kemper
1650bb3d56 CSRF protection from cross-origin <script> tags
Thanks to @homakov for sounding the alarm about JSONP-style data leaking
2013-12-17 13:14:17 -07:00
Yves Senn
bb0bc7a26f Merge pull request #13346 from chancancode/release_notes_etc
Release notes fixes [ci skip]
2013-12-17 08:56:27 -08:00
Godfrey Chan
2003d0409e Some assorted fixes for the 4.1 release notes:
* Added release notes for secrets.yml and mentioned it in the highlights
* Added release notes for Mailer previews and mentioned it in the highlights
* Added release notes for Module#concerning
* Removed mention for AV extraction from the highlights
* Rearranged the major features to put highlighted features first
* Various improvements and typo fixes

[ci skip]
2013-12-17 08:39:07 -08:00
Carlos Antonio da Silva
6802196a6b Disable available locales checks to avoid warnings running the tests 2013-12-17 09:05:41 -02:00
Andrew White
d6dec7fcb6 Add mailer previews feature based on mail_view gem 2013-12-17 03:58:35 +00:00
Rafael Mendonça França
108171a44e Merge pull request #13307 from akshay-vishnoi/typo
Spelling and Grammar check [ci skip]
2013-12-15 11:19:44 -08:00
Akshay Vishnoi
c758093eca Spelling and Grammar check [ci skip] 2013-12-16 00:44:37 +05:30
robertomiranda
35d0d6fec5 Update secret_key_base Docs 2013-12-15 10:32:41 -05:00
Philipe Fatio
fd76b9d546 Fix syntax error in redirect_to example
Without parenthesis, ruby assumes that curly braces denote the beginning
of a block.
2013-12-14 15:35:50 +01:00
Carlos Antonio da Silva
07fd25c759 Merge pull request #13293 from akshay-vishnoi/typo
Spelling and Grammar checks [ci skip]
2013-12-12 08:12:13 -08:00
Rafael Mendonça França
1454f2c20a Merge pull request #13290 from strzalek/inline-syntax-docs
Variants inline syntax documentation
2013-12-12 07:59:17 -08:00
Akshay Vishnoi
5fccd77b6c Spelling and Grammar checks 2013-12-12 18:28:34 +05:30
Łukasz Strzałkowski
3ce9563d42 Variants inline syntax documentation [ci skip]
* Extend method documentation
  * Mention it in actionpack/CHANGELOG
  * Update release notes
2013-12-12 13:20:45 +01:00
Carlos Antonio da Silva
fe24f3560a Changelog improvements [ci skip] 2013-12-12 08:33:46 -02:00
Damien Mathieu
6645a2099a Merge pull request #13288 from dvsuresh/fix_typo
Fix typo in action_controller responder.rb [ci skip]
2013-12-12 00:13:52 -08:00
dvsuresh
25a5c5f236 Fix typo in action_controller responder.rb 2013-12-12 02:03:58 -06:00
Godfrey Chan
ebfd97124d Merge pull request #13284 from aayushkhandelwal11/typos_corrected
s/everytime/every time/
2013-12-11 22:13:04 -08:00
Aayush khandelwal
4a9e54ef35 typos rectified [ci skip] 2013-12-12 11:29:23 +05:30
Trent Ogren
96a6703ed9 Update CHANGELOG entry for Session#fetch
This reverts the changes to CHANGELOG.md in commit
38f8872aa5fd8f0a1d0895e9eb41f73261acd040.
2013-12-11 19:26:45 -06:00
Trent Ogren
d0fc760d09 Make ActionDispatch::Request::Session#fetch behave like Hash#fetch
Session#fetch was mutating the session when given a default argument
and/or a block. Since Session duck-types as a Hash, it should behave
like one in these cases.
2013-12-11 15:29:33 -06:00
Piotr Sarnacki
e6c602da90 Fix mounting engines inside a resources block
When a route is mounted inside a resources block, it's automatically
prefixed, so a following code:

    resources :users do
      mount Blog::Engine => '/blog'
    end

will generate a user_blog path helper.

In order to access engine helpers, we also use "mounted_helpers", a list
of helpers associated with each mounted engine, so a path to blog's post
can be generated using user_blog.post_path(user, post).

The problem I'm fixing here is that mount used a raw :as option, without
taking nestings into account. As a result, blog was added to a route set
as a `user_blog`, but helper was generated for just `blog`.

This commit applies the proper logic for defining a helper for a mounted
engine nested in resources or resource block.

(closes #8533)
2013-12-10 21:38:41 +01:00
Łukasz Strzałkowski
edacdbfaf9 Inline variants syntax
In most cases, when setting variant specific code, you're not sharing any code
within format.

Inline syntax can vastly simplify defining variants in those situations:

  respond_to do |format|
    format.js { render "trash" }
    format.html do |variant|
      variant.phone { redirect_to progress_path }
      variant.none  { render "trash" }
    end
  end

Becomes:

  respond_to do |format|
    format.js         { render "trash" }
    format.html.phone { redirect_to progress_path }
    format.html.none  { render "trash" }
  end
2013-12-10 11:55:43 +01:00
Łukasz Strzałkowski
fbb6be50a5 Simplify @responses hash initialization
@responses hash needs to be initialized with mime types that we get from
Collector#collect_mimes_from_class_level. Mime::Type class as key and nil as
value. This need to happen before content negotiation. Before that, it was
looping though mime types and executing mime-type-generated method inside
collector (see
AbstractController::Collector#generate_method_for_mime). That approach resulted
in 2 unnecessary method calls for each mime type
collected by Collector#collect_mimes_from_class_level.

Now hash is initialized in place, without usage of Collector#custom method.
2013-12-10 11:47:50 +01:00
David Heinemeier Hansson
4aae538d9f Revert "Merge pull request #13235 from strzalek/variants-inline" -- needs a little more work!
This reverts commit 186161148a189839a1e0924043f068a8d155ce69, reversing
changes made to cad9eb178ea5eec0e27d74e93518f4ed34e2f997.
2013-12-08 14:04:04 -08:00
David Heinemeier Hansson
186161148a Merge pull request #13235 from strzalek/variants-inline
Inline syntax for variants
2013-12-08 13:38:01 -08:00
Łukasz Strzałkowski
2647d2f656 Inline variants syntax
In most cases, when setting variant specific code, you're not sharing any code
within format.

Inline syntax can vastly simplify defining variants in those sitiations:

  respond_to do |format|
    format.js { render "trash" }
    format.html do |variant|
      variant.phone { redirect_to progress_path }
      variant.none  { render "trash" }
    end
  end
`
Becomes:

  respond_to do |format|
    format.js         { render "trash" }
    format.html.phone { redirect_to progress_path }
    format.html.none  { render "trash" }
  end
2013-12-08 22:29:07 +01:00
Łukasz Strzałkowski
9b8c0ff391 Simplify @responses hash initialization
@responses hash needs to be initialized with mime types that we get from
Collector#collect_mimes_from_class_level. Mime::Type class as key and nil as
value. This need to happen before content negotiation. Before that, it was
looping though mime types and executing mime-type-generated method inside
collector (see
AbstractController::Collector#generate_method_for_mime). That approach resulted
in 2 unnecessary method calls for each mime type
collected by Collector#collect_mimes_from_class_level.

Now hash is initialized in place, without usage of Collector#custom method.
2013-12-08 22:11:46 +01:00
Łukasz Strzałkowski
d99dd0af03 Require action_view explicitly in AC::Base 2013-12-08 13:03:41 +01:00
David Heinemeier Hansson
99975e742e Variants can be declared without a block to signify their presence in the controller 2013-12-07 16:32:38 -08:00
David Heinemeier Hansson
a16fa9abfd Allow code execution in case no variant has been set with variant.none 2013-12-07 15:00:35 -08:00
Arun Agrawal
7f10232b9e Fixed test for Mime::VCF
Added here 13dd38cee79be39f7b399e142fd78295dddd2abb
2013-12-06 08:15:43 +01:00
David Heinemeier Hansson
13dd38cee7 Add Mime::Type.register "text/vcard", :vcf to the default list of mime types 2013-12-05 15:49:06 -08:00
Jeremy Kemper
5086c8c211 Merge pull request #13189 from strzalek/retain-ap-av-dep
Retain ActionPack dependency on ActionView. Fixes #12979.
2013-12-05 07:25:17 -08:00
Bernard Potocki
e8572cf2f9 Add configuration option to optionally disable deep_munge 2013-12-05 12:08:34 +01:00
Yves Senn
d71c1fc6a7 add missing CHANGELOG entry for d8c6f52. [ci skip]
Discoverd by #13175.
2013-12-05 11:41:12 +01:00
Carlos Antonio da Silva
d6eda3ef3c Remove missing integration points of AV extraction 2013-12-05 11:39:56 +01:00
Shota Fukumori (sora_h)
c1d5477b63 Escalate missing error when :raise is true
Before ec16ba75a5493b9da972eea08bae630eba35b62f,
ActionView::Helpers::TranslationHelper#translate has raised errors with
specifying options[:raise] to true.

This should work by this fix:

     begin
       t(:"translations.missing", raise: true)
     rescue I18n::MissingTranslationData
       p :hello!
     end
2013-12-05 09:20:58 +09:00
Łukasz Strzałkowski
d8888b94b3 Retain ActionPack dependency on ActionView 2013-12-05 01:02:46 +01:00
Rafael Mendonça França
2d061c2c4f Update changelog [ci skip] 2013-12-04 17:48:32 -02:00
Angelo capilleri
2f3fe92f1b remove nil in NullType#ref.
Return Nil is implicit in a method and this syntax is used in the others
classes
2013-12-04 17:55:05 +01:00