Commit Graph

28498 Commits

Author SHA1 Message Date
Kassio Borges
0ec701d50b Load fixtures from linked folders 2013-08-05 16:52:12 -03:00
Rafael Mendonça França
773eca0e12 Move changelog entry to the top [ci skip] 2013-07-30 21:59:10 -03:00
Rafael Mendonça França
1463fbeafb Fix broken test
quote_value is called on the object not the class
2013-07-24 16:21:37 -03:00
Ben Woosley
b4dea61a42 Tidy up the "Specified column type for quote_value" changes
This includes fixing typos in changelog, removing a deprecated
mocha/setup test require, and preferring the `column_for_attribute`
accessor over direct access to the columns_hash in the new code.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/locking/optimistic.rb
2013-07-24 13:20:30 -03:00
Alfred Wong
33e1604b3e Specified column type for quote_value
When calling quote_value the underlying connection sometimes requires
more information about the column to properly return the correct quoted
value.

I ran into this issue when using optimistic locking in JRuby and the
activerecord-jdbcmssql-adapter. In SQLSever 2000, we aren't allowed to
insert a integer into a NVARCHAR column type so we need to format it as
N'3' if we want to insert into the NVARCHAR type. Unfortuantely, without
the column type being passed the connection adapter cannot properly return
the correct quote value because it doesn't know to return N'3' or '3'.

This patch is fairly straight forward where it just passes in the column
type into the quote_value, as it already has the ability to take in the column,
so it can properly handle at the connection level.

I've added the tests required to make sure that the quote_value method
is being passed the column type so that the underlying connection can
determine how to quote the value.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/locking/optimistic.rb
2013-07-24 13:18:21 -03:00
Rafael Mendonça França
c4b93f57e1 Merge pull request #11563 from 90yukke/fix-nomethoderror-on-non-attribute-equalities
Fix merge error when Equality LHS is non-attribute.
2013-07-23 05:29:17 -07:00
90yukke
b289519f4f Fix merge error when Equality LHS is non-attribute.
This is reworking of rails/rails/pull/7380 made for rails 3.
2013-07-23 10:38:00 +03:00
Rafael Mendonça França
e0db277be0 Fix actionpack CHANGELOG entry
It was included by git on the wrong release
2013-07-22 20:25:20 -03:00
Rafael Mendonça França
2b3ce8627b Merge branch '3-2-14' into 3-2-stable 2013-07-22 20:24:09 -03:00
Rafael Mendonça França
c69ccea6f2 Fix activemodel CHANGELOG 2013-07-22 20:23:42 -03:00
Rafael Mendonça França
2fcd13eff2 Preparing for 3.2.14 release 2013-07-22 12:05:41 -03:00
Rafael Mendonça França
47fb44fc7a Update CHANGELOG entry 2013-07-22 11:57:02 -03:00
Andrew White
d8353073d1 Add test to prevent route reloading regression
Journey doesn't clear its named route hash when the routes are reloaded but
Rails 3.2 isn't affected because Journey overwrites the existing route. This
is just a backport of the test to make sure it doesn't become affected in
some future release.
2013-07-21 17:48:24 +01:00
Rafael Mendonça França
ed19c02c8d Merge pull request #11486 from wolframarnold/3-2-stable_fix_respond_to_missing_in_tagged_loggging
3-2-stable patch: Add respond_to_missing? in TaggedLoggging
2013-07-18 10:46:52 -07:00
Rafael Mendonça França
39441f78e3 Merge pull request #10800 from 907th/fix-custom-message-for-assert_redirected_to
Fix #10842. `assert_redirected_to` does not show user-supplied message.
2013-07-17 22:12:42 -07:00
Alexey Chernenkov
0f5ba6e124 Fix assert_redirected_to does not show user-supplied message.
Issue: when `assert_redirected_to` fails due to the response redirect not
matching the expected redirect the user-supplied message (second parameter)
is not shown. This message is only shown if the response is not a redirect.
2013-07-18 10:54:36 +06:00
Wolfram Arnold
803008eb97 Add respond_to_missing? for TaggedLogging which is needed if another log abstracter wraps a TaggedLogging instance.
It's also best practice when overriding method_missing.
2013-07-17 18:26:55 -07:00
Carlos Antonio da Silva
ac5cc69571 Merge pull request #11468 from arunagw/removed_unsed_test
Removed unused test file
2013-07-17 09:49:06 -07:00
Arun Agrawal
fc0faaa590 Removed unused test file
This test file is not be running from a long time
This test is already covered in controller/caching_test.rb
2013-07-17 11:47:24 +02:00
Rafael Mendonça França
a96df04aac Preparing for 3.2.14.rc2 release 2013-07-16 13:00:33 -03:00
Rafael Mendonça França
1900a56669 Use Ruby 1.8 syntax 2013-07-15 17:45:20 -03:00
Rafael Mendonça França
66cba60103 Use Ruby 1.8 syntax 2013-07-15 17:44:49 -03:00
Yves Senn
1c2545a455 Merge pull request #11451 from jetthoughts/11450_do_not_resave_destroyed_association
Do not re-save destroyed association on saving parent object
Conflicts:
	activerecord/lib/active_record/autosave_association.rb

Conflicts:
	activerecord/CHANGELOG.md
2013-07-15 15:49:42 -03:00
Yves Senn
2ae2728d78 Merge pull request #11451 from jetthoughts/11450_do_not_resave_destroyed_association
Do not re-save destroyed association on saving parent object
Conflicts:
	activerecord/lib/active_record/autosave_association.rb
2013-07-15 15:48:43 -03:00
Rafael Mendonça França
facfc24f25 Preparing for 3.2.14.rc1 release 2013-07-12 21:06:50 -03:00
Andrew White
714cb5a436 Add missing require so that DateTime has the right superclass
If the DateTime core extensions were loaded before the Date core extensions
then you would get a superclass mismatch as DateTime hasn't been defined
yet so it gets set to Object by the acts_like core extension.

Fixes #11206

(cherry picked from commit 78f7d5b652000dbb1a11d34fe370c3fa82de840c)
2013-07-10 16:16:02 +01:00
Andrew White
b775987e72 Return local time for backwards compatibility 2013-07-09 15:40:59 +01:00
Andrew White
ccad803bf4 Retain offset and fraction when using Time.at_with_coercion
The standard Ruby behavior for Time.at is to return the same type of
time when passing an instance of Time as a single argument. Since the
an ActiveSupport::TimeWithZone instance may be a different timezone than
the system timezone and DateTime just understands offsets the best we
can do is to return an instance of Time with the correct offset.

It also maintains the correct fractional second value as well.

Fixes #11350.

Backports:
484253515c0e05760541dc48946361185c9e6904
1b3873730b96035a238dbff7627bd5942e6dc4e7
2013-07-09 14:04:49 +01:00
Rafael Mendonça França
d704c1cb98 Do not shallow the original exception in exec_cache
when result_error_field is not defined on result raise the original
exception.

Fixes #11260
2013-07-09 07:41:32 -03:00
Rafael Mendonça França
c4ad10e254 Remove git dependecy 2013-07-08 14:55:25 -03:00
Rafael Mendonça França
2ce875dfbd Add license to the gemspec 2013-07-08 14:51:19 -03:00
Rafael Mendonça França
b5830d168b New changelog entries always on the top [ci skip] 2013-07-06 20:14:50 -03:00
Rafael Mendonça França
a72a0eb85b Remove warning of assigned but unused variable 2013-07-06 17:16:37 -03:00
Rafael Mendonça França
29106ce99c Skip connection url test when the machine is using socket configuration.
The connection url parssing don't accept the socket option
2013-07-06 17:10:55 -03:00
Santiago Pastorino
e359e3ab93 Add missing require 2013-07-02 17:00:33 -07:00
Rafael Mendonça França
b9771813e3 Merge pull request #8881 from carsonreinke/3-2-stable
3-2-stable ActiveSupport::TaggedLogging logging progname issue
2013-07-01 11:36:19 -07:00
Carson Reinke
4265f1bccb Incorrectly providing program name the same as log message even when block is not provided. 2013-07-01 10:11:43 -04:00
Yves Senn
9a8f59340b unify duplicate CHANGELOG entry 2013-06-27 22:00:27 +02:00
Yves Senn
0a55bd7c6b Merge pull request #9173 from senny/backport_perftest_fix
Backport rails/rails-perftest#2 to fix rake test:benchmark
2013-06-27 12:55:36 -07:00
Yves Senn
b47f8d035e clear ARGV to prevent mintest autorun errors:
Minitest expects the first argument in `ARGV` to be the path to a test file.
Because `rails benchmarker` and `rails profiler` define an on-the-fly test-case,
using the first `ARGV` to pass the code to execute this results in:

```
/Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: 1000.times{"a string"} (ArgumentError)
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:21:in `run'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'
```

clearing ARGV after defining the test-case solves this issue.
2013-06-27 21:11:03 +02:00
Yves Senn
1db54d7d01 Backport rails/rails-perftest#2 to fix rake test:benchmark 2013-06-27 20:44:08 +02:00
Yves Senn
63d4894a58 Merge pull request #11019 from tkhr/test_case_for_issue_10393
Add test case for issue #10393 and fix warning message
2013-06-25 23:42:35 -07:00
Yves Senn
cacfa8e3fb build fix, fall back to old hash syntax 2013-06-26 08:33:44 +02:00
chapmajs
839efc5b6d Allow global override of default STI inheritance column
This change fixes a bug by which 3.2-STABLE users can't globally override the default STI inheritance column with `ActiveRecord::Base.inheritance_column = 'some_column'`. 3.2-STABLE users are forced to use a deprecated method or monkey patch it otherwise.

Test case written by tkhr <takehiro0740@gmail.com>.
2013-06-26 14:55:18 +09:00
Yves Senn
b23e0d6639 Merge pull request #9893 from JonRowe/add_test_to_assert_association_doesnt_overwrite
Add a test to assert autosaving associations doesn't overwrite id accessor methods
2013-06-25 22:45:36 -07:00
Carlos Antonio da Silva
cde6ead573 Move changelog entry to the top [ci skip] 2013-06-25 22:05:54 -03:00
Carlos Antonio da Silva
07c6262c25 Merge pull request #10373 from janko-m/fix-store-accessor
Fix a bug in ActiveRecord::Store accessors
2013-06-25 22:03:01 -03:00
Yves Senn
27b3883846 Revert "Revert "Merge pull request #10901 from armstrjare/fix_query_null_foreign_key_on_new_record_collection_ids_reader""
This reverts commit 5009b07887.

Also updated the CHANGELOG and adjusted the test-case to match the one on master.
2013-06-25 18:07:06 +02:00
Andrew White
b0c65978ab Use old style hash syntax for 3-2-stable 2013-06-25 12:24:06 +01:00
Andrew White
622e4ab424 Fix shorthand routes where controller and action are in the scope
Merge `:action` from routing scope and assign endpoint if both `:controller`
and `:action` are present. The endpoint assignment only occurs if there is
no `:to` present in the options hash so should only affect routes using the
shorthand syntax (i.e. endpoint is inferred from the the path).

Fixes #9856

Backport of 37b4276
2013-06-25 11:00:19 +01:00