Commit Graph

43183 Commits

Author SHA1 Message Date
Yves Senn c5cbc695bd add CHANGELOG for f6e293ec54. [ci skip]
Conflicts:
	actionpack/CHANGELOG.md
2015-02-25 18:11:34 +01:00
Jeremy Kemper 1458db17c1 Fix default headers in test responses
Fixes regression in #18423. Merge default headers for new responses,
but don't merge when creating a response from the last session request.

hat tip @senny ❤️
2015-02-25 10:07:56 -07:00
Aaron Patterson 59c8c894fc Merge pull request #17426 from jpcody/fixture_associations_fix
Rely on through table name in has_many fixtures
2015-02-25 11:58:25 -03:00
Sean Griffin 4b662081dc Maintain null values when validating uniqueness
Fixes #19051
2015-02-25 11:55:22 -03:00
Sean Griffin 1e1d0f1c38 Maintain null values when validating uniqueness
Fixes #19051
2015-02-24 19:55:05 -07:00
Rafael Mendonça França 17bc8d2dbe Merge pull request #19055 from ianks/model_name.to_json
activemodel: make .model_name json encodable
2015-02-24 15:06:33 -03:00
Rafael Mendonça França ac26bd1d80 Merge pull request #17069 from modosc/master
move cache_digests rake methods into their own namespace
2015-02-20 20:32:23 -02:00
Rafael Mendonça França a698862cbc Preparing for 4.1.10.rc1 release 2015-02-20 19:50:05 -02:00
Rafael Mendonça França cbe4708ba8 Merge branch 'rm-take' into 4-1-stable 2015-02-20 19:15:35 -02:00
Rafael Mendonça França dbbcdeff92 Add test to take with inverse_of 2015-02-20 19:15:11 -02:00
Rafael Mendonça França 70b5d522e8 Do not need to implement take! on collection_proxy
It is already the default implementation
2015-02-20 19:14:26 -02:00
Rafael Mendonça França 3d287d315b Merge pull request #16935 from powershop/has_many_take_on_loaded_association
Implement #take and #take! on associations such as has_many
2015-02-20 18:40:59 -02:00
Rafael Mendonça França abb92690ee Merge pull request #17139 from mfazekas/fix_becomes_changed_attributes
Always reset changed attributes in becomes
2015-02-20 15:03:46 -02:00
Rafael Mendonça França a73b31a673 Merge pull request #17138 from jpcody/rename_default_form_builder
Rename default_form_builder to avoid collision
2015-02-20 14:25:29 -02:00
Rafael Mendonça França 7e230e2610 Merge pull request #18992 from rails/rm-track-lock-file
Track Gemfile.lock at the repository
2015-02-18 15:57:22 -02:00
Sean Griffin ce20853aff Merge pull request #18932 from mcmire/ew-uniqueness-array-scopes
Scopes can be array columns for uniq. validator
2015-02-13 15:42:59 -07:00
Elliot Winkler d47801b8cb Scopes can be array columns for uniq. validator
`validates_uniqueness_of` would blow up when used with a scope that was
an array column. The validator must perform a query to determine whether
the record already exists in the database, and uses the scope to do so.
When it constructs the query, it deserializes the value of the scope (an
array). Unfortunately this breaks the query because Postgres is still
expecting that value to be an array. There is a newer version of Arel
that prevents this from happening, but 4.1 is not on that version, so we
have to emulate that code here.
2015-02-13 15:36:57 -07:00
Godfrey Chan 2fd126a419 Properly dump primitive-like AS::SafeBuffer strings as YAML
`coder.represent_scalar` means something along the lines of "Here is a quoted
string, you can just add it to the output", which is not the case here. It only
works for simple strings that can appear unquoted in YAML, but causes problems
for e.g. primitive-like strings ("1", "true").

`coder.represent_object` on the other hand, means that "This is the Ruby-object
representation for this thing suitable for use in YAML dumping", which is what
we want here.

Before:

   YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml  # => "Hello"
   YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml   # => true
   YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml  # => false
   YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml      # => 1
   YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml    # => 1.1

 After:

   YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml  # => "Hello"
   YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml   # => "true"
   YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml  # => "false"
   YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml      # => "1"
   YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml    # => "1.1"

If we ever want Ruby to behave more like PHP or JavaScript though, this is an
excellent trick to use ;)

Conflicts:
	activesupport/CHANGELOG.md
2015-02-11 17:12:35 -08:00
Sean Griffin d2091b2a82 Merge pull request #17771 from agis-/issue-17373
Local vars should exist in partials for falsy `:object:` values too
2015-02-11 14:49:54 -02:00
Yves Senn 1a033b1017 A `NullRelation` should represent nothing. Closes #15176.
[Matthew Draper & Yves Senn]

Closes #16860.

Conflicts:
	activerecord/CHANGELOG.md
2015-02-11 16:47:50 +01:00
Sean Griffin ac1fbc1734 Deep clone a relation's AST when it is used as a subselect.
This caused some obscure aliasing issues when we re-order bind params.
Fixes #12753.
2015-02-10 08:56:38 -07:00
Yves Senn a0eee64c1f Merge pull request #18462 from dmasur/patch-1
Removing :en in favor of default locale for duration#inspect
2015-02-09 08:55:27 +01:00
Andrew White b719b65e7f Force generated route to be inserted
Thor isn't very discerning over whether some content is present when passed
to `inject_into_file`, e.g. a commented out route is detected as being present.
So to prevent people scratching their heads as to why a route hasn't appeared
it's better to fall on the side of having duplicate routes.

(cherry picked from commit 80838d9bd5)
2015-02-05 18:01:27 +00:00
Andrew White 4b592e56db Don't remove all line endings from routes.rb
When there is a single scaffold in the routes.rb with no other lines
then revoking/destroying it will create a routes.rb file with a syntax
error. This is because the sentinel for the Thor `route` action didn't
include the newline but the logged route code did.

The fix is to add the newline to the sentinel and remove it from the
the logged route code.

Fixes #15913.

(cherry picked from commit 1c59ffca5c)

Conflicts:
	railties/CHANGELOG.md
2015-02-05 18:00:56 +00:00
Sean Griffin b8ba202d54 Respect custom primary keys for associations in `Relation#where`
While we query the proper columns, we go through normal handling for
converting the value to a primitive which assumes it should use the
table's primary key. If the association specifies a different value (and
we know that we're working with an association), we should use the
custom primary key instead.

Fixes #18813.

Conflicts:
    activerecord/lib/active_record/relation/predicate_builder/association_query_handler.rb
    activerecord/lib/active_record/table_metadata.rb
2015-02-04 09:07:57 -07:00
Andrew White f82ea4aa29 Merge pull request #18803 from tekin/dont-blat-default-format-4-1
Backport #18627 to 4-1-stable
2015-02-04 12:14:17 +00:00
Tekin Suleyman a2f7f54a33 Preserve the default format when generating URLs
Fixes an issue that would cause the format set in default_url_options to be lost
when generating URLs with fewer positional arguments than parameters in the
route definition.

This is a backport of #18627 that only fixes the issue for :format so as not to
break existing behaviour.
2015-02-04 22:31:57 +11:00
Xavier Noria 432e86cd11 fix kindlerb version [ci skip]
This means we know generation works with this version, it does not
mean it does not work with the last releases (should be tested).
2015-01-31 15:08:35 +01:00
Akira Matsuda e0d23fec62 require 'rails' if not include_all_railties, just as 'rails/all' does 2015-01-29 20:26:30 -02:00
Rafael Mendonça França e0ebfaddd6 Merge pull request #18722 from bogdan/group-by-key-word
Fixed AR::Relation#group method when argument is a SQL reserved keyword
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/query_methods.rb
2015-01-29 15:02:52 -02:00
Rafael Mendonça França 5136a75204 Use a mustache version that works with Ruby 1.9 2015-01-14 11:17:56 -02:00
Rafael Mendonça França 3c6e8e8987 Merge pull request #18390 from tgxworld/parallel_bundle_install
Use parallel bundler install.
2015-01-14 11:10:46 -02:00
Andrey Novikov b25efc0f39 Add missing time zone definitions for Russian Federation
Also sync Russian Federation time zones with `zone.tab` file from tzdata version 2014j.

(cherry picked from commit f996dcf7ef)

Conflicts:
	activesupport/CHANGELOG.md
2015-01-13 19:27:40 +00:00
Guillermo Iguaran ac75b70643 Merge pull request #18429 from robertomiranda/patch-2
Update Changelog, 4.1.9 release is missing [ci-skip]
2015-01-09 19:55:35 -05:00
Roberto Miranda d1800a97a7 Update Changelog, 4.1.9 release is missing 2015-01-09 19:39:21 -05:00
Yves Senn d316c0af31 Merge pull request #18423 from jone/remove-default-header
Default headers, removed in controller actions, will not be reapplied to the test response

Conflicts:
	actionpack/CHANGELOG.md
2015-01-09 17:06:50 +01:00
Rafael Mendonça França 13a5f84827 Merge branch '4-1-9' into 4-1-stable
Conflicts:
	actionpack/CHANGELOG.md
	activerecord/CHANGELOG.md
	railties/CHANGELOG.md
2015-01-06 17:06:23 -03:00
Arthur Neves cca85ba699 Fix test/cases/adapters/postgresql/bytea_test after ed2b4eb 2015-01-06 16:14:35 -03:00
Rafael Mendonça França 5d9f3cf272 Preparing for 4.1.9 release 2015-01-06 13:00:36 -03:00
Rafael Mendonça França ed2b4eb1cb Do no unescaped already unescaped bytea values
If the unescaped value contains a null byte, pg 0.18 will raise an
exception.
2015-01-06 12:58:04 -03:00
Rafael Mendonça França a1e133dfbc Merge pull request #17941 from robertjlooby/fix_batches_reverse_order_bug_4-1
ignore reverse_order when finding in batches
2015-01-05 15:33:29 -03:00
Rafael Mendonça França 761f6cde7d Merge pull request #17676 from tigrish/fix_custom_i18n_exception_handler_regression
Fix I18n regression introduced by #13832
2015-01-05 14:54:54 -03:00
Rafael Mendonça França 19b9086585 Remove some warnings
Conflicts:
	railties/test/application/configuration_test.rb
2015-01-03 17:18:55 -03:00
Rafael Mendonça França 242abf7da4 Merge pull request #18308 from jcoyne/i18n_translate_safety
Unsafe default translations should not be marked html_safe
Conflicts:
	actionview/CHANGELOG.md
	actionview/lib/action_view/helpers/translation_helper.rb
2015-01-02 20:57:06 -03:00
Rafael Mendonça França 5effd24b04 Add missing encoding header 2015-01-02 19:01:56 -03:00
Rafael Mendonça França f8d974fc9f Don't test invalid log encoding against PostgreSQL adapter
It already treats the message
2015-01-02 19:01:02 -03:00
Rafael Mendonça França faa7b56fcf Merge pull request #8547 from printercu/patch-1
fix for messages in invalid encoding from db-drivers

Conflicts:
	activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
	activerecord/test/cases/connection_adapters/abstract_adapter_test.rb
2015-01-02 16:18:33 -03:00
Rafael Mendonça França ff062fe58a Revert "Merge pull request #17820 from fw42/restore_query_cache_on_rollback"
This reverts commit 5dc0bb9203.

This broke the build. Reverting until future investigation
2015-01-02 16:16:06 -03:00
Rafael Mendonça França 5dc0bb9203 Merge pull request #17820 from fw42/restore_query_cache_on_rollback
Clear query cache on rollback
2015-01-02 14:37:14 -03:00
Rafael Mendonça França 7d8e56ab07 Merge pull request #15309 from iantropov/issue_12698_build_through
Add setting of FK for throgh associations while building

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/associations/has_many_through_associations_test.rb

Conflicts:
	activerecord/CHANGELOG.md
2015-01-02 14:31:58 -03:00