Commit Graph

7356 Commits

Author SHA1 Message Date
Rob Sanheim
0afd326c36 Move commit exception handling to a method so we can override
It looks like these methods all get included into the AbstractAdapter,
and then in github/github we have our own Adapter as an internal gem.

So this should be easy enough to override in our vendor'ed adapter.

This will allow us to still grab errors that happen in `after_commit`
which would normally be swallowed in Rails 3.0 (and beyond).

Conflicts:
	activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
2014-09-26 16:25:08 +10:00
Rob Sanheim
c957f5f609 only _run_commit_callbacks when destroyed or persisted:
should fix issues with commit callbacks getting called when the record
is not persisted (yet) in a inner transaction or due to some other edge
case.

see also caabed6c76

Conflicts:
	activerecord/lib/active_record/transactions.rb
2014-09-26 16:19:59 +10:00
Charlie Somerville
78e6c36ba3 convert times to local when quoting for db 2014-09-19 17:50:29 +10:00
Arthur Neves
7cbeae9a5c Make sure transaction state resets after commit
[fixes #12566]

Conflicts:
	activerecord/test/cases/transaction_callbacks_test.rb
2014-09-18 14:23:36 +10:00
Charlie Somerville
7684d715ef Merge remote-tracking branch 'upstream/3-2-stable' into 3-2-github 2014-09-15 14:04:33 +10:00
Rafael Mendonça França
53c845cb18 Preparing for 3.2.19 release 2014-07-02 12:55:09 -03:00
Rafael Mendonça França
1f2192e46d Check against bit string values using multiline regexp
Fix CVE-2014-3482.
2014-07-02 12:49:01 -03:00
Rafael Mendonça França
bbec7d72be Merge branch '3-2-sec' into 3-2-stable
Conflicts:
	actionpack/CHANGELOG.md
2014-05-06 13:31:07 -03:00
Rafael Mendonça França
4e8f1d2588 Preparing for 3.2.18 release 2014-05-06 11:33:10 -03:00
Charlie Somerville
bb861052e8 only run tests with sqlite 2014-04-10 21:35:48 +10:00
Rafael Mendonça França
a3bda38467 Merge branch '3-2-17' into 3-2-stable
Conflicts:
	actionpack/CHANGELOG.md
2014-02-18 15:57:32 -03:00
Rafael Mendonça França
666e9f65bd Preparing for 3.2.17 release 2014-02-18 15:16:57 -03:00
Chris Maddox
1805682efa Update Session Store Documentation
session_id doesn't need to be a text column, just string (VARCHAR)
2013-12-13 17:02:16 -08:00
Aaron Patterson
64226302d8 updating the changelog 2013-12-02 16:17:19 -08:00
Aaron Patterson
538f8ba0c1 updating changelogs 2013-10-16 10:01:01 -07:00
Aaron Patterson
2a0c4403fd bumping to 3.2.15 2013-10-15 11:48:53 -07:00
Aaron Patterson
e3abd78ee5 bumping to rc3 2013-10-11 14:16:06 -07:00
Rafael Mendonça França
38aefa51c3 Revert "Merge pull request #12413 from arthurnn/inverse_of_on_build"
This reverts commit ccd11d5891, reversing
changes made to 54c05acdba.

Reason: This caused a regression when the associated record is created
in a before_create callback. See
https://github.com/rails/rails/pull/12413#issuecomment-25848163
2013-10-10 14:55:12 -03:00
Rafael Mendonça França
fbc69ac560 Revert "Merge pull request #12443 from arthurnn/add_inverse_of_add_target"
This reverts commit 7ed5bdc834, reversing
changes made to 31c79e291f.

Reason: this caused a regression when the associated record is creted in
a before_create callback.

See https://github.com/rails/rails/pull/12413#issuecomment-25848163
2013-10-10 14:55:07 -03:00
Aaron Patterson
5ede19b772 bumping to rc2 2013-10-04 13:46:35 -07:00
Rafael Mendonça França
73dff26125 Merge pull request #12443 from arthurnn/add_inverse_of_add_target
Add inverse of add target
2013-10-04 13:58:36 -03:00
Aaron Patterson
5e277c8208 bumping version to 3.2.15.rc1 2013-10-03 11:52:44 -07:00
Aaron Patterson
31c79e291f Merge pull request #12084 from Ben-M/3-2-stable
Fix STI scopes using benolee's suggestion. Fixes #11939
2013-10-03 11:14:19 -07:00
Arthur Neves
679860400f Move set_inverse_instance to association.build_record
[fixes #10371]
2013-09-30 17:20:26 -04:00
Arthur Neves
fed6ac9c66 fix inverse_of when find_or_initialize_by_*
inverse_of relation was not being set when calling find_or_initialize_by_ and the entry was
found on the db.
2013-09-26 14:55:10 -04:00
Arthur Neves
e1bb9fc671 on tests: dont always touch firm on validate 2013-09-25 19:50:42 -04:00
Rafael Mendonça França
fdc3c08e55 Merge pull request #12359 from arthurnn/inverse_on_callbacks
Make sure inverse_of is visible on the has_many callbacks
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/models/company.rb
2013-09-25 16:31:00 -03:00
Eugene Kalenkovich
c9642e31b1 Fix FinderMethods#last unscoped primary key
Fixes table.joins(:relation).last(N) breaking on sqlite

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/finder_test.rb
2013-09-12 14:08:02 -03:00
Arthur Neves
f0301e3de6 on SchemaCache use the connection getter instead of the obj given 2013-09-09 13:47:07 -04:00
Ben Maraney
cf1904f65b Fix STI scopes using benolee's suggestion. Fixes #11939 2013-08-30 12:58:41 +03:00
Kassio Borges
0ec701d50b Load fixtures from linked folders 2013-08-05 16:52:12 -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
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
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
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
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
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
2ce875dfbd Add license to the gemspec 2013-07-08 14:51:19 -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
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