Commit Graph

40844 Commits

Author SHA1 Message Date
Birkir A. Barkarson
8dd4aca485 Fix breakage in XmlMini
- Boolean parsing breaks on non strings (i.e. integer 1|0)
- Symbol parsing breaks on non strings.
- BigDecimal parsing breaks due to missing require.
- Update changelog.
2013-12-23 14:04:16 +09:00
Jeremy Kemper
5542dff88a Merge pull request #13007 from chancancode/dont_call_as_json_with_nil
Don't call #as_json on children of Array and Hash with nil when no arguments are passed
2013-11-22 16:01:22 -08:00
Yves Senn
818b362c1d Merge pull request #12774 from exAspArk/fix_uniqueness_on_relation
Fix validation on uniqueness
2013-11-22 13:58:15 -08:00
Godfrey Chan
663c059d4a When Array#as_json and Hash#as_json are called without options, they
should also call #as_json on the children without options (instead of
nil)
2013-11-22 11:01:40 -08:00
Evgeny Li
c449a74e89 Fix validation on uniqueness of empty association 2013-11-22 22:22:34 +04:00
Rafael Mendonça França
34c08d2ead Use a more generic assertion to make sure this tests will be useful.
Since we are using assert_no_match, if we change the code before
changing the tests, the tests will still pass and the assertion will
become useless
2013-11-22 14:53:31 -02:00
Rafael Mendonça França
d5b71591df Merge pull request #13003 from laurocaetano/fix_assertion_for_turbolinks
Fix the assertion for not inclusion of turbolinks on application.js.
2013-11-22 07:57:24 -08:00
Lauro Caetano
5ba606e1c6 Fix the assertion for not inclusion of turbolinks on application.js.
We were asserting if `//= turbolinks` was not present while the correct is
asserting that `//= require turbolinks` is not present.
2013-11-22 10:49:41 -02:00
Carlos Antonio da Silva
18964368f3 Improve changelogs
Also make Action Mailer changelog format more consistent with the
others [ci skip]
2013-11-22 08:30:04 -02:00
Yves Senn
93f24cfb1d Merge pull request #13000 from arunagw/build-fix-rake-test
Build fix for new routing inspector changes
2013-11-21 23:55:34 -08:00
Arun Agrawal
a6c06217a5 Build fix for new routing inspector changes
Broken by

6701b4cf41f6f3d9cfc6a93715acbf852d1e468e
2013-11-22 08:51:12 +01:00
Guillermo Iguaran
16bbb8efc4 Merge pull request #12996 from shreve/patch-2
Added a missing close parenthesis to i18n.md
2013-11-21 19:43:04 -08:00
Jacob Evan Shreve
c796cc2ba7 Added a missing close parenthesis to i18n.md 2013-11-21 22:18:17 -05:00
Rafael Mendonça França
dfb1dbb719 Merge pull request #12993 from laurocaetano/skip_turbolinks
Option to skip turbolinks
2013-11-21 17:51:33 -08:00
Lauro Caetano
c09ef94a49 Remove turbolinks when generating a new application based on a template
that skips it.

It can be skipped adding `add_gem_entry_filter { |gem| gem.name != "turbolinks" }` to the template.
2013-11-21 23:31:57 -02:00
Rafael Mendonça França
47229208fc Merge pull request #12994 from sbagdat/fix_for_info_title
Fix for titles of info pages
2013-11-21 17:27:24 -08:00
Sıtkı Bağdat
cf863f466e Fix for titles of info pages
Both `rails/info/properties` and `rails/info/routes` have same html
title attribute as *Routes*. This commit includes a fix for the titles.
2013-11-22 03:02:57 +02:00
Rafael Mendonça França
8973a5af83 Merge pull request #12992 from arunagw/build-fix-routing-inspector
Build fix for Routing Inspector
2013-11-21 16:05:24 -08:00
Arun Agrawal
7917a5a5ff Build fix for Routing Inspector
Broken by

6701b4cf41f6f3d9cfc6a93715acbf852d1e468e
2013-11-22 00:45:51 +01:00
Rafael Mendonça França
b39b3652e1 Revert "Merge pull request #12990 from vipulnsward/remove_visualizer_param"
This reverts commit 5a19346d2855ecb1c791cdef3af92589566d00db, reversing
changes made to d82588ee4756b03025813b3997f4db171ee0fcdc.

This argument is being used in the view
5a19346d28/actionpack/lib/action_dispatch/journey/visualizer/index.html.erb (L4)

It is being set using the binding
5a19346d28/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb (L108)
2013-11-21 17:49:00 -02:00
Rafael Mendonça França
5a19346d28 Merge pull request #12990 from vipulnsward/remove_visualizer_param
Remove unused param `title`to  `TransitionTable#visualizer`
2013-11-21 11:19:42 -08:00
Vipul A M
1a2eb04566 Remove unused param titleto TransitionTable#visualizer 2013-11-22 00:44:10 +05:30
Xavier Noria
d82588ee47 Merge pull request #12962 from kamipo/call_initialize_schema_migrations_table_from_migration
Use `SchemaStatements#initialize_schema_migrations_table` instead of `ActiveRecord::SchemaMigration.create_table`.
2013-11-21 09:27:44 -08:00
Yves Senn
f71cbb81ff unify punctuation in Action Pack changelog. [ci skip] 2013-11-21 18:10:38 +01:00
Yves Senn
941516f225 Merge pull request #12975 from sbagdat/fix-for-rake-routes
Fix for routes task
2013-11-21 09:07:57 -08:00
Yves Senn
7ae22cda3f doc travel and travel_to stubs are removed in teardown. [ci skip] 2013-11-21 18:00:40 +01:00
Sıtkı Bağdat
6701b4cf41 Fix for routes task
This commit fixes formatting issue for `rake routes` task, when a section is shorter than a header.
2013-11-21 18:35:58 +02:00
Yves Senn
e2fbec96d4 replace custom Time stubbing with travel and travel_to. 2013-11-21 17:29:53 +01:00
Carlos Antonio da Silva
68aebd4895 Merge pull request #12970 from prathamesh-sonpatki/issue12885
Add positional information to eval call so that this information will be used in printing correct location where the exception occurred.

Closes #12885.
2013-11-21 04:10:16 -08:00
Carlos Antonio da Silva
05052390f2 Merge pull request #12986 from budnik/fix-unicode-nbsp
replace U+00A0 with whitespace, Fixes #12985
2013-11-21 03:49:15 -08:00
Dmitriy Budnik
f1ffedb233 replace U+00A0 with whitespace 2013-11-21 13:25:16 +02:00
Xavier Noria
9b423c9811 Merge pull request #12976 from tmm1/faster-blank
Faster String#blank?
2013-11-20 16:47:41 -08:00
Aman Gupta
30ba7ee596 Expand double-negative in String#blank? regex 2013-11-20 14:55:55 -08:00
Jon Leighton
64b9e93bb5 Fix ActiveRecord::Relation#unscope
I'm pretty confused about the addition of this method. The documentation
says that it was intended to allow the removal of values from the
default scope (in contrast to #except). However it behaves exactly the
same as except: https://gist.github.com/jonleighton/7537008 (other than
having a slightly enhanced syntax).

The removal of the default scope is allowed by
94924dc32baf78f13e289172534c2e71c9c8cade, which was not a change we
could make until 4.1 due to the need to deprecate things. However after
that change #unscope still gives us nothing that #except doesn't already
give us.

However there *is* a desire to be able to unscope stuff in a way that
persists across merges, which would allow associations to be defined
which unscope stuff from the default scope of the associated model. E.g.

  has_many :comments, -> { unscope where: :trashed }

So that's what this change implements. I've also corrected the
documentation. I removed the guide references to #except as I think
unscope really supercedes #except now.

While we're here, there's also a potential desire to be able to write
this:

  has_many :comments, -> { unscoped }

However, it doesn't make sense and would not be straightforward to
implement. While with #unscope we're specifying exactly what we want to
be removed from the relation, with "unscoped" we're just saying that we
want it to not have some things which were added earlier on by the
default scope. However in the case of an association, we surely don't
want *all* conditions to be removed, otherwise the above would just
become "SELECT * FROM comments" with no foreign key constraint.

To make the above work, we'd have to somehow tag the relation values
which get added when evaluating the default scope in order to
differentiate them from other relation values. Which is way too much
complexity and therefore not worth it when most use cases can be
satisfied with unscope.

Closes #10643, #11061.
2013-11-20 22:23:16 +00:00
Prathamesh Sonpatki
26f8fb8641 Add positional information to eval call so that this information will
be used in printing correct location where the exception occurred.
Closes #12885

- Without this the location of exception is always the line on which
  'eval' is called
- But if the exception occurs in a gem outside of Rails, then that
  location is not printed in stacktrace
2013-11-20 22:48:08 +05:30
Yves Senn
da800614ca swap arguments for some assert_equal statements => expected, actual 2013-11-20 13:58:09 +01:00
Xavier Noria
b43b6d5c82 Merge pull request #12824 from sikachu/ps-testing-time-helper
Add `#travel` and `#travel_to` to `ActiveSupport::TestCase`
2013-11-20 01:21:43 -08:00
Prem Sichanugrist
225cd915cf Add #travel and #travel_to to AS::TestCase
Add `ActiveSupport::Testing::TimeHelpers#travel` and `#travel_to`. These
methods change current time to the given time or time difference by
stubbing `Time.now` and `Date.today` to return the time or date after
the difference calculation, or the time or date that got passed into the
method respectively. These methods also accept a block, which will
return current time back to its original state at the end of the block.

Example for `#travel`:

    Time.now # => 2013-11-09 15:34:49 -05:00
    travel 1.day
    Time.now # => 2013-11-10 15:34:49 -05:00
    Date.today # => Sun, 10 Nov 2013

Example for `#travel_to`:

    Time.now # => 2013-11-09 15:34:49 -05:00
    travel_to Time.new(2004, 11, 24, 01, 04, 44)
    Time.now # => 2004-11-24 01:04:44 -05:00
    Date.today # => Wed, 24 Nov 2004

Both of these methods also accept a block, which will return the current
time back to its original state at the end of the block:

    Time.now # => 2013-11-09 15:34:49 -05:00

    travel 1.day do
      User.create.created_at # => Sun, 10 Nov 2013 15:34:49 EST -05:00
    end

    travel_to Time.new(2004, 11, 24, 01, 04, 44) do
      User.create.created_at # => Wed, 24 Nov 2004 01:04:44 EST -05:00
    end

    Time.now # => 2013-11-09 15:34:49 -05:00

This module is included in `ActiveSupport::TestCase` automatically.
2013-11-20 16:05:02 +07:00
Ryuta Kamizono
5d788e94f0 Use SchemaStatements#initialize_schema_migrations_table instead of ActiveRecord::SchemaMigration.create_table. 2013-11-20 11:42:06 +09:00
Rafael Mendonça França
1ffa4abcd5 Merge pull request #12961 from jbaudanza/doc
Update caching guide with respect to :namespace
2013-11-19 17:20:59 -08:00
Jonathan Baudanza
99eb1eb4df Update caching guide with respect to :namespace
Cache::Store does not have a default value for :namespace. If it ever did, I can't find it in the git history.
2013-11-19 17:06:50 -08:00
Rafael Mendonça França
4f28e54424 _implied_layout_name should be private 2013-11-19 22:55:19 -02:00
Rafael Mendonça França
5487f62741 Use the right indentation 2013-11-19 22:53:32 -02:00
Rafael Mendonça França
ed7e4932f4 Renderer#_render_template should be private
Closes #12831
2013-11-19 22:52:06 -02:00
Rafael Mendonça França
1f88fedd6f Merge pull request #12959 from macmartine/partial_renderer_doc_improvement
Improve readability of sentence in partial-renderer docs [ci skip]
2013-11-19 15:59:32 -08:00
Mac Martine
6251eb992f Improve readability of sentence in partial-renderer docs [ci skip] 2013-11-19 15:46:00 -08:00
Yves Senn
f83c9b10b4 use arel nodes to represent non-string order_values.
This fixes a bug when merging relations of different classes.

```
Given:
  Post.joins(:author).merge(Author.order(name: :desc)).to_sql

Before:
 SELECT "posts".* FROM "posts"
   INNER JOIN "authors" ON "authors"."id" = "posts"."author_id"
   ORDER BY "posts"."name" DESC

After:
 SELECT "posts".* FROM "posts"
   INNER JOIN "authors" ON "authors"."id" = "posts"."author_id"
   ORDER BY "authors"."name" DESC
```
2013-11-19 17:40:21 +01:00
Rafael Mendonça França
a7afceec3e Revert "Properly require database tasks so we have access to the raised constant"
This reverts commit fbcd46b1a0d255a34d29caa77bbd31c287446333.

This is not needed anymore. See 7280965
2013-11-19 13:08:06 -02:00
Rafael Mendonça França
728096542a Revert "Explicitly exit with status "1" for create and drop failures"
This reverts commit 22f80ae57b26907f662b7fd50a7270a6381e527e.

See
22f80ae57b (commitcomment-4640676)

Conflicts:
	activerecord/CHANGELOG.md
2013-11-19 13:07:28 -02:00
Yves Senn
a6f58a535e use arel master and update activerecord to depend on arel 5.0.0.
This is a follow-up to 3053fee954c1e28b23f7e00921d7b9b3b3867fa5.

> The `master` branch should use the `master` branch.
2013-11-19 15:34:20 +01:00