Commit Graph

6614 Commits

Author SHA1 Message Date
Aaron Patterson
52a9884ce4 remove unused instance variable 2011-11-28 15:23:26 -08:00
Aaron Patterson
beff819a4d just check in all connections 2011-11-28 15:23:26 -08:00
Aaron Patterson
884a04007f remove useless class_eval 2011-11-28 15:23:25 -08:00
Aaron Patterson
dde2113867 Move connection resoluion logic to it's own testable class. 2011-11-28 15:23:25 -08:00
Aaron Patterson
30f7c59e90 clean up string => hash conversion for connection pool 2011-11-28 15:23:25 -08:00
Aaron Patterson
ffb218c750 pools are 1:1 with spec now rather than 1:1 with class 2011-11-28 15:23:25 -08:00
Aaron Patterson
2a9a8ad4df break establish_connection to smaller methods 2011-11-28 15:23:24 -08:00
Jakub Kuźma
d1afd98746 added information about callbacks created by autosave association (#3639) 2011-11-28 19:37:00 +01:00
Aaron Patterson
ba0b3eee14 Merge pull request #3768 from janv/master
Test and fix for Issue 3450
2011-11-28 09:35:43 -08:00
José Valim
5f75a92c32 Merge pull request #3657 from arunagw/mysql2_bump_master
Bump Mysql2!
2011-11-28 03:15:30 -08:00
José Valim
89925e817c Revert "Use any instead of length"
This reverts commit 1756629835.
2011-11-28 11:18:39 +01:00
Jan Varwig
cba5a3a367 Test case and fix for rails/rails#3450
Asssigning a parent id to a belongs_to association actually updates the object that is validated when the association has :validates => true
2011-11-27 22:29:56 +01:00
Jon Leighton
b00cf122e2 Merge pull request #3748 from samsonasu/has_many_custom_pk_new_record
New records should load has_many relationships with custom primary keys
2011-11-27 13:05:19 -08:00
Rahul P. Chaudhari
1756629835 Use any instead of length 2011-11-27 20:02:09 +05:30
Xavier Noria
1be9830d4d add the query to AR::Relation#explain output
Rationale: this is more readable if serveral queries
are involved in one call. Also, it will be possible
to let AR log EXPLAINs automatically in production
mode, where queries are not even around.
2011-11-25 14:29:34 -08:00
Brian Samson
0f5104d720 load has_many associations keyed off a custom primary key if that key is present but the record is unsaved 2011-11-25 08:24:54 -07:00
José Valim
8896b4fdc8 Implement ArraySerializer and move old serialization API to a new namespace.
The following constants were renamed:

  ActiveModel::Serialization     => ActiveModel::Serializable
  ActiveModel::Serializers::JSON => ActiveModel::Serializable::JSON
  ActiveModel::Serializers::Xml  => ActiveModel::Serializable::XML

The main motivation for such a change is that `ActiveModel::Serializers::JSON`
was not actually a serializer, but a module that when included allows the target to be serializable to JSON.

With such changes, we were able to clean up the namespace to add true serializers as the ArraySerializer.
2011-11-23 23:18:15 +00:00
Arun Agrawal
13847ccb43 Bump Mysql2! 2011-11-22 18:47:27 +05:30
Aaron Patterson
5d704fa152 oops! I suck! 💣 2011-11-20 15:11:11 -08:00
Aaron Patterson
008abd17dc fixing tests on ruby 1.8 2011-11-20 15:09:03 -08:00
Arun Agrawal
be9d3a2008 Bump Arel 2011-11-20 12:27:25 +05:30
Aaron Patterson
599d7c40a4 removing deprecated methods 2011-11-19 20:43:04 -08:00
Aaron Patterson
24fa524cef adding visitors to the respective adapters 2011-11-19 20:28:41 -08:00
Aaron Patterson
bd2f5c062d pushing caching and visitors down to the connection 2011-11-19 20:19:53 -08:00
Jon Leighton
fec85cf10d Perf fix
If we're deleting all records in an association, don't add a IN(..)
clause to the query.

Fixes #3672.
2011-11-19 14:11:29 +00:00
Jon Leighton
2ef4947ab0 Add missing CHANGELOG entry for #3678. Closes #3678. 2011-11-19 13:34:50 +00:00
Jon Leighton
11afb74089 Merge pull request #3687 from kennyj/fix_3678-2
Use `show index from`. We could fix `pk_and_sequence_for` method's performance problem (GH #3678)
2011-11-19 05:00:37 -08:00
Jon Leighton
9c37416a3e Verify that #3690 has been closed by previous changes to the mysql
adapters.

These tests fail on the v3.1.2 tag.

Closes #3690.
2011-11-19 12:34:15 +00:00
kennyj
f9b9179016 Use show index from. We could fix pk_and_sequence_for method's performance problem (GH #3678) 2011-11-19 04:19:31 +09:00
Christos Zisopoulos
280b2b725b Only used detailed schema introspection when doing a schema dump.
Fixes #3678
2011-11-18 18:29:47 +01:00
Sam Ruby
42954c426b Stop db:seed from performing a reload of the db
Fix regression introduced by 38d26b0cb5
2011-11-18 10:05:06 -05:00
Vijay Dev
1c4564b620 Merge pull request #3666 from oscardelben/databases_rake_cleanup
Cleanup of databases.rake psql env variables
2011-11-18 04:21:56 -08:00
Aaron Patterson
a2f14e2344 Revert "Merge pull request #1163 from amatsuda/sexier_migration_31"
This reverts commit 0e407a9041, reversing
changes made to 533a9f84b0.

Conflicts:

	activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
	activerecord/test/cases/migration_test.rb
2011-11-17 10:29:28 -08:00
Aaron Patterson
649f2513a4 Revert "Merge pull request #3603 from vijaydev/change_table_without_block_arg"
This reverts commit 81fad6a270, reversing
changes made to 23101de283.

Conflicts:

	activerecord/test/cases/migration_test.rb
2011-11-17 10:29:28 -08:00
Oscar Del Ben
a89fabbb02 Cleanup of databases.rake psql env variables 2011-11-17 18:49:47 +01:00
Arun Agrawal
5ccd9bcc1a No need to readlines then join, just use read ❤️
same as 4c1a1933cb
2011-11-17 12:24:40 +05:30
Aaron Patterson
4c1a1933cb No need to readlines then join, just use read ❤️ 2011-11-16 16:18:00 -08:00
Aaron Patterson
bb95e81538 Adding a deprecation warning for use of the schema_info table. 2011-11-16 15:51:25 -08:00
Aaron Patterson
97ca6358c5 Join method uses empty string by default, so remove it 2011-11-16 15:40:20 -08:00
Aaron Patterson
b96aaf8ccb dbfile isn't supported anymore, so remove 2011-11-16 15:31:37 -08:00
Aaron Patterson
ca69408b49 Reduce schema format tests 2011-11-16 15:31:37 -08:00
Aaron Patterson
38d26b0cb5 Move conditionals to separate tasks so they can be reused. 2011-11-16 15:31:37 -08:00
James Adam
73cb0f9828 ActiveRecord::Base#becomes should retain the errors of the original object.
This commit contains a simple failing test that demonstrates the behaviour we expect, and a fix. When using `becomes` to transform the type of an object, it should retain any error information that was present on the original instance.
2011-11-16 23:19:58 +00:00
Aaron Patterson
cef1e14e09 removing some useless conditionals 2011-11-16 14:46:20 -08:00
Aaron Patterson
43821bf351 Merge pull request #2948 from atambo/master
schema_format :sql should behave like schema_format :ruby
2011-11-16 14:37:24 -08:00
Aaron Patterson
61228e9a0c fixing tests on PG 2011-11-16 13:25:55 -08:00
Ryan Naughton
63a22ca616 Fixes issue #3483, regarding using a mixture of ranges and discrete values in find conditions. Paired with Joey Schoblaska. 2011-11-14 21:43:27 -06:00
Gabriel Sobrinho
e1b79c56be Failing test case for issue #3483 2011-11-14 21:39:03 -06:00
José Valim
9fa329b754 Speed up attribute invocation by checking if both name and calls are compilable. 2011-11-14 20:12:17 +01:00
Aaron Patterson
11c9fc9364 Merge pull request #3371 from yahonda/fix_ora_00932_error
Fix ORA-00932 error when trying to insert 0 to DATE type columns.
2011-11-14 04:36:55 -08:00