Jon Leighton
e51ecfaaa3
extract method
2011-11-29 20:13:37 +00:00
Jon Leighton
7af719e81c
Deprecate set_sequence_name in favour of self.sequence_name=
2011-11-29 20:13:37 +00:00
Jon Leighton
fd7ca98bb6
Add tests for set_sequence_name etc
2011-11-29 20:13:36 +00:00
Jon Leighton
34609d67b4
Deprecate set_inheritance_column in favour of self.inheritance_column=
2011-11-29 20:13:36 +00:00
Jon Leighton
0b72a04d0c
Deprecate set_table_name in favour of self.table_name= or defining your own method.
2011-11-29 20:13:36 +00:00
Aaron Patterson
f73f53455a
respond_to? information of AR is not the responsibility of the spec
...
resolver.
2011-11-29 11:48:55 -08:00
Jon Leighton
2169603385
Merge pull request #3636 from joshsusser/master
...
association methods are now generated in modules
2011-11-29 10:09:42 -08:00
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
Josh Susser
124c97fbe2
avoid warnings
...
This change uses Module.redefine_method as defined in ActiveSupport.
Making Module.define_method public would be as clean in the code, and
would also emit warnings when redefining an association. That is pretty
messy given current tests, so I'm leaving it for someone else to decide
what approach is better.
2011-11-27 14:15:40 -08:00
Josh Susser
10834e975a
changelog & docs for GeneratedFeatureMethods
2011-11-27 14:12:46 -08: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
Josh Susser
61bcc318c8
use GeneratedFeatureMethods module for associations
2011-11-27 11:22:12 -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
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
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