Commit Graph

41222 Commits

Author SHA1 Message Date
Aayush khandelwal
4a9e54ef35 typos rectified [ci skip] 2013-12-12 11:29:23 +05:30
Aaron Patterson
11c0ef58a6 Merge pull request #13260 from arunagw/using-parallelize_me
Using parallelize_me! to parallelize isolated test
2013-12-10 14:17:42 -08:00
Arun Agrawal
5743926d51 Using parallelize_me! to parallelize isolated test
As ParallelEach is no more available

related commit ec00442c10cb90796909e876fb1cc557ed7518bd
2013-12-10 22:09:58 +01:00
Piotr Sarnacki
308f37f94d Merge pull request #12699 from drogus/fix-mounting-engine-in-resources
Fix mounting engines inside a resources block
2013-12-10 13:07:56 -08: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
Santiago Pastorino
b5c5121f67 Revert "Rename not Ruby files to .tt"
This reverts commit bd360ad3c1d59273bf96ea01b17cf04285816dc2.

Reverting this for now until we fix the Thor related issue
2013-12-10 18:05:13 -02:00
Damien Mathieu
031ce1f581 Merge pull request #13258 from semaperepelitsa/docs
Fix typo in docs, missing colon in Symbol literal
2013-12-10 11:37:50 -08:00
Semyon Perepelitsa
1cd965000b Fix typo in docs, missing colon in Symbol literal [ci skip] 2013-12-11 03:03:49 +08:00
José Valim
dbe6a8b03b Merge pull request #13257 from eshira/optimize-gsub
Replace with gsub! in ActiveSupport::Inflector
2013-12-10 09:44:05 -08:00
Elben Shira
88cff33a63 Replace with gsub! in ActiveSupport::Inflector. 2013-12-10 11:25:06 -06:00
Santiago Pastorino
bd360ad3c1 Rename not Ruby files to .tt 2013-12-10 13:50:57 -02:00
David Heinemeier Hansson
ea3808771b Merge pull request #13253 from strzalek/variants-inline2
Variants inline syntax v2
2013-12-10 07:05:54 -08:00
Yves Senn
e74a9f9eea make collect_deprecations available.
There are circumstances where the capabilities of `assert_deprecated` and
`assert_not_deprecated` are not enough. For example if a ccertain call-path
raises two deprecations but should only raise a single one.

This module is still :nodoc and intented for internal use.

/cc @rafaelfranca
2013-12-10 15:22:31 +01:00
Yves Senn
821153525c Merge pull request #13236 from jetthoughts/13230_type_cast_bug_in_agr_functions
Fix type cast on group sum with custom expression
2013-12-10 05:29:25 -08:00
Paul Nikitochkin
2a7fe7ae9b Fix type cast on group sum with custom expression
For PG adapters with custom expression and grouped result
of aggregate functions have not found correct column type
for it. Extract column type from query result.

Closes: #13230
2013-12-10 14:30:12 +02: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
Yves Senn
900191fe2c doc: date/conversions.rb should talk about date format not time format.
Closes #13245.

[ci skip]
2013-12-10 11:09:31 +01:00
Carlos Antonio da Silva
7cf9a43268 Fix warnings on mysql2 explain test 2013-12-10 08:06:48 -02:00
Jeremy Kemper
2fd067c33b Merge pull request #13248 from yahonda/support_mysql573_explain
Support MySQL 5.7 explain
2013-12-09 23:22:32 -08:00
Jeremy Kemper
26cea8fabe Merge pull request #13247 from yahonda/support_mysql573_primary_key
From http://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-3.html:
"Columns in a PRIMARY KEY must be NOT NULL, but if declared explicitly as NULL produced no error. Now an error occurs."
2013-12-09 23:21:37 -08:00
Yasuo Honda
b6655885ef Remove DEFAULT NULL for primary key column to support MySQL 5.7.3
Since MySQL 5.7.3 m13 does now allow primary key column is null.
2013-12-10 11:12:33 +09:00
Yasuo Honda
75f453ff4c Support MySQL 5.7 explain 2013-12-10 11:04:09 +09: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
Guillermo Iguaran
cad9eb178e Merge pull request #13231 from chancancode/upgrade_minitest
Upgrade minitest version
2013-12-08 07:40:23 -08:00
Godfrey Chan
849dbb5da8 Upgrade minitest version
We made a change in #13213 that depends on a new file that's only in
minitest 5.1.0+, so the version should be updated.
2013-12-08 07:35:19 -08:00
Rafael Mendonça França
f86c830981 Merge pull request #13232 from strzalek/av-missing-requires
Require action_view explicitly in AC::Base
2013-12-08 06:18:18 -08: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
Godfrey Chan
76dae289ed Merge pull request #13221 from stereoscott/patch-1
fix tiny typo in comment, "state_state" should be "stale_state" [ci skip]
2013-12-06 22:46:07 -08:00
Scott M
4b6b6c8d8a fix typo, "state_state" should be "stale_state" [ci skip] 2013-12-07 01:24:22 -05:00
Godfrey Chan
dd59228082 Merge pull request #13219 from robin850/patch-11
Very tiny typo fix [ci skip]
2013-12-06 11:29:18 -08:00
Robin Dupret
8cfab46837 Very tiny typo fix [ci skip] 2013-12-06 20:21:12 +01:00
Rafael Mendonça França
a220b1518d Merge pull request #13059 from imkmf/cycle-accepts-array
Cycle object should accept an array

Conflicts:
	actionview/CHANGELOG.md
2013-12-06 17:05:59 -02:00
Kristian Freeman
1eaa521273 A Cycle object should accept an array and cycle through it as it would
with a set of comma-separated objects.
2013-12-06 10:57:37 -08:00
Aaron Patterson
12544f9422 Merge pull request #13213 from arunagw/aa-minitest-version-fix
Minitest upgrade broke build
2013-12-06 10:40:48 -08:00
Godfrey Chan
92812ba09d Merge pull request #13214 from JuanitoFatas/master
Some improvements on building nested forms. [ci skip]
2013-12-06 10:32:10 -08:00
Xavier Noria
01c9782fa2 better error message for constants autoloaded from anonymous modules [fixes #13204]
load_missing_constant is a private method that basically plays the role of const_missing.
This method has an error condition that is surprising: it raises if the class or module
already has the missing constant. How is it possible that if the class of module has
the constant Ruby has called const_missing in the first place?

The answer is that the from_mod argument is self except for anonymous modules, because
const_missing passes down Object in such case (see the comment in the source code of the
patch for the rationale).

But then, it is better to pass down Object *if Object is also missing the constant* and
otherwise err with an informative message right away.
2013-12-06 19:18:10 +01:00
Juanito Fatas
a7713765d9 Some improvements on building nested forms. [ci skip] 2013-12-07 02:04:50 +08:00
Jeremy Kemper
8ef1ef1b82 Merge pull request #10635 from vipulnsward/change_to_strict
Use `Base.strict_decode64` instead of `Base.decode64`
2013-12-06 08:08:28 -08:00
Arun Agrawal
ec00442c10 Minitest upgrade broke build
34760e3b26

This PR should fix build
2013-12-06 16:53:14 +01:00
Rafael Mendonça França
747c616aa7 Merge pull request #13216 from arunagw/plugin-gemfile-jruby
Skipping debugger from plugin Gemfile for JRuby
2013-12-06 07:52:20 -08:00
Arun Agrawal
f1a05e741d Skipping debugger from plugin Gemfile for JRuby 2013-12-06 16:48:28 +01:00
Rafael Mendonça França
6413fdeb52 Merge pull request #13210 from chancancode/more_enum_docs
Enum doc fixes
2013-12-06 03:03:39 -08:00
Carlos Antonio da Silva
d78b3ecdee Merge pull request #13212 from arunagw/vcf-mime-type-build-fix
Fixed test for Mime::VCF
2013-12-06 01:46:43 -08:00
Arun Agrawal
7f10232b9e Fixed test for Mime::VCF
Added here 13dd38cee79be39f7b399e142fd78295dddd2abb
2013-12-06 08:15:43 +01:00