Anatoliy Lysenko
66dd2d3d10
Fix bug in collection_singular_ids on has many through association with conditions and includes,
...
when condtions references tables from includes.
Test fail because of invalid sql:
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: comments.id:
SELECT "posts".id FROM "posts" INNER JOIN "readers" ON "posts"."id" = "readers"."post_id"
WHERE "readers"."person_id" = 1 AND (comments.id is null)
Bug described in github#925
This commit will revert fix from 3436fdfc12 , but tests is ok.
Bug described in #6569 ticket.
2011-07-06 23:23:34 +03:00
Santiago Pastorino
c713cf9a5d
Merge pull request #1273 from jeremyf/feature-association-proxy-send
...
Addresses an inconsistency in the ActiveRecord::Base.method_missing handl
2011-07-06 13:05:58 -07:00
Santiago Pastorino
d5bd7030e5
Merge pull request #1494 from anildigital/master
...
Fix failing test because of Timezone difference.
2011-07-06 12:23:19 -07:00
Jon Leighton
2c72830cd9
Merge pull request #1979 from bogdan/association_sum_array_compatibility
...
Fixed AR::Relation#sum compatibility with Array#sum
2011-07-06 00:49:05 -07:00
Santiago Pastorino
b27871a66f
Merge pull request #1968 from bogdan/associations_find_array_compatibility2
...
Fixed CollectionAssociation#find to be compatible with Array#find
2011-07-05 09:41:09 -07:00
Bogdan Gusiev
e7bec4e435
Fixed AR::Relation#sum compatibility with Array#sum
...
In order make Relation behavior closer to Array
Made Relation#sum to accept block and delegate it to Array#sum
2011-07-05 14:36:20 +03:00
Bogdan Gusiev
8ba0c1ac53
Fixed CollectionAssociation#find to be compatible with Array#find
...
In order to make CollectionAssociation behave closer to Array
Add the ability to pass block to #find method just like Array#find does.
2011-07-05 10:51:40 +03:00
Dieter Komendera
7d3aa2462c
Only call set_owner_attributes for has_one association if target exists.
2011-07-04 18:43:09 +02:00
Vijay Dev
15f35c0ac0
Reversing the changes done in c278a2c while still resolving #1857 .
...
The changes broke bulk migration tests and were fixed in 4d256bc6;
however that brought back the issue of #1857 and so this commit goes
back to the original scenario and just adds change_table to the list
of methods which are to be recorded in the CommandRecorder. The
method_missing now delegates all calls to the underlying connection as
before.
2011-07-02 23:43:13 +05:30
Jon Leighton
0e225ec583
Assign the association attributes to the associated record before the before_initialize callback of the record runs. Fixes #1842 .
2011-06-30 23:39:58 +01:00
Aaron Patterson
f261ef42cc
cache the plural name on the reflection so we do not pay pluralize costs on joins
2011-06-30 15:31:22 -07:00
Jon Leighton
4d256bc6b1
CommandRecorder should delegate in method_missing where possible. Fixes some tests in migration_test.rb under mysql. The problem was introduced in c278a2c5e1.
2011-06-30 00:47:35 +01:00
Aaron Patterson
59e38803e9
Merge pull request #1574 from oriolgual/1571_ar_relation_order_no_longer_works_with_arel_nodes
...
Fix #1571 ActiveRecord::Relation#order no longer works with arel ordering nodes
2011-06-28 14:55:15 -07:00
Oriol Gual
eb933f0154
Add more test cases
2011-06-28 22:10:51 +02:00
Oriol Gual
e174923d29
Add failing test
2011-06-28 22:10:50 +02:00
Raimonds Simanovskis
f838b47b87
Fix test_finding_with_cross_table_order_and_limit for Oracle
...
Use latest Arel syntax and pass each order by expression as separate argument to order method as otherwise invalid Oracle SQL is generated.
2011-06-28 23:04:42 +03:00
Aaron Patterson
941d5c1f40
Merge pull request #1857 from vijaydev/irreversible-migration
...
IrreversibleMigration is not raised when a method not supported by reversible migrations is called in the change method of a migration
2011-06-28 12:05:19 -07:00
Aaron Patterson
a5cb5a5af6
Merge pull request #1860 from dmathieu/comparison
...
Allow comparison on model objects - Closes #1858
2011-06-28 11:46:25 -07:00
Aaron Patterson
6054c092dc
oops! remove debugging codes
2011-06-27 14:46:56 -07:00
Aaron Patterson
997aed24be
default create_with_value to a hash so we can eliminate conditionals, add test surrounding create_with(nil) behavior
2011-06-27 14:18:49 -07:00
Damien Mathieu
eb22c51173
comparing different classes returns nil
2011-06-26 09:41:30 +02:00
Damien Mathieu
bc743dc1ce
allow comparison on model objects - Closes #1858
2011-06-26 09:41:08 +02:00
Vijay Dev
c278a2c5e1
record unsupported methods in CommandRecorder instead of letting the unsupported methods go through to the underlying db causing errors like duplicate columns to occur when rolling back migrations
2011-06-25 17:17:02 +05:30
Santiago Pastorino
d6413f043c
Merge pull request #1848 from raviolicode/postgresql_order_multiple_params
...
Fix for complex ordering of multiple columns on postgresql
2011-06-24 13:09:33 -07:00
Lucia Escanellas
9734a416fa
Improve ordering of multiple columns on postgresql
...
* Only on postgresql, order("first asc, second asc") was invalid
* Closes #1720
2011-06-24 13:37:08 -03:00
Jon Leighton
87d6865bf7
Apply the default scope earlier when doing calculations. Fixes #1682 .
2011-06-23 19:57:49 +01:00
Aaron Patterson
09866cef17
Merge pull request #1790 from ernie/reverse_sql_order_fix
...
Support reversal of ARel orderings in reverse_sql_order
2011-06-22 08:30:52 -07:00
Aaron Patterson
ceb5bbbafc
Merge pull request #1632 from tardate/pg_schema_fu
...
Improving PostgreSQL adapter schema-awareness
2011-06-21 10:22:20 -07:00
Ernie Miller
08f3f30994
Support reversal of ARel orderings in reverse_sql_order
2011-06-20 14:15:19 -04:00
José Valim
7d4606156b
Merge pull request #1763 from grantneufeld/schema_column_exists_options_hash
...
Fix default options argument on ActiveRecord::ConnectionAdaptors::Table#column_exists?
2011-06-18 19:34:39 -07:00
Paul Gallagher
2b3d67fdaf
Merge remote branch 'rails/master' into pg_schema_fu
2011-06-19 10:21:15 +08:00
Paul Gallagher
b0d59907f7
Make PostgreSQL adapter view-compatible
...
* amongst other things, allows meta_search to run against view-backed models
2011-06-19 10:14:17 +08:00
Steve Hodgkiss
50444204cc
Fix inconsistencies by being polite to the wrapped body. Needed for Rack::Sendfile to function properly. See issue #1761 .
2011-06-18 22:30:01 +01:00
Grant Neufeld
3cc83a8f24
Changed the default value for the options argument on ActiveRecord::ConnectionAdapters::Table#column_exists? from nil to an empty Hash {}.
...
That method calls through to ActiveRecord::ConnectionAdapters::SchemaStatements##column_exists? expects options to be a Hash.
When options was nil, an error would occur in cases where the column did exist because the called method attempted to perform a key lookup on options.
2011-06-18 14:38:38 -06:00
Jon Leighton
e510c2c642
Add require 'pathname' as it has not already been required in some circumstances
2011-06-17 14:55:34 +01:00
Andrew White
5d655aabcb
Pass mass-assignment options to nested models - closes #1673 .
2011-06-13 13:02:51 +01:00
Andrew White
987afa583e
Rename tests to reflect associations
2011-06-13 10:01:38 +01:00
Jon Leighton
86bbba1ffb
Add support for using an ARCONFIG environment variable to specify the location of the config.yml file for running the tests
2011-06-12 19:08:16 +01:00
Jon Leighton
15e289147e
Oops, this should have been in the last commit ⚡
2011-06-12 19:05:29 +01:00
Jon Leighton
c52520166b
Make assert_no_queries literally enforce that there are no queries. As in, not a single line of SQL should be sent to the database, not even stuff that is ignored by assert_queries. The argument being that if you write assert_no_queries, you really do not want there to be any queries.
2011-06-12 18:50:24 +01:00
Jon Leighton
232c66a1ba
If we're going to use a global variable, let's at least namespace it
2011-06-12 18:38:39 +01:00
Jon Leighton
14e6bbb149
Refactor tests to be less brittle
2011-06-12 18:19:21 +01:00
Jon Leighton
de01a64102
Move BEGIN and COMMIT into IGNORED_SQL rather than having them as a special case in assert_queries
2011-06-12 18:19:21 +01:00
benedikt
fa8dfad765
Don't wrap operations on collection associations in transactions when they are not needed, so the connection adapter does not send empty BEGIN COMMIT transactions blocks to the database.
2011-06-12 18:19:21 +01:00
Paul Gallagher
f8c4b374c8
make extract_schema_and_table a private method
2011-06-11 18:34:09 +08:00
Paul Gallagher
1d7c751bf7
remove table quoting in primary_key method
...
* add/cleanup tests
2011-06-11 02:21:24 +08:00
Paul Gallagher
019c263633
apply private method indentation convention
...
* tidy test code and fix my typo
2011-06-10 22:48:58 +08:00
Paul Gallagher
5c7f8c929b
Improve PostgreSQL adapter schema-awareness
...
* table_exists? scoped by schema search path unless schema is explicitly named. Added tests and doc to clarify the behaviour
* extract_schema_and_table tests and implementation extended to cover all cases
* primary_key does not ignore schema information
* add current_schema and schema_exists? methods
* more robust table referencing in insert_sql and sql_for_insert methods
2011-06-10 21:52:25 +08:00
Jon Leighton
4b371b602b
Print out information about whether the identity map is on or off when running unit tests
2011-06-09 20:20:51 +01:00
Sebastian Martinez
9af4e803ec
Remove unused 'y' variable.
2011-06-08 23:13:59 -03:00