Commit Graph

6229 Commits

Author SHA1 Message Date
Aaron Patterson
ba1b88fda6 Merge pull request #1636 from metaskills/upstream/3-1-stable
Allow the connection pool's #table_exists? method to give the connections
2011-06-17 00:02:45 -07:00
Jon Leighton
be99ae78c9 Perf fix - Use an instance variable instead of a class_attribute. Thanks @josevalim and @jhawthorn for the prompting. 2011-06-16 21:13:56 +01:00
Arun Agrawal
536e1566b6 Bump mysql2 to 0.3.5 2011-06-16 10:45:58 +05:30
Santiago Pastorino and José Ignacio Costa
e445a79562 Bump mysql2 up 2011-06-16 01:05:45 -03: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
b09bbdb8bf Replace inline lambdas with named methods 2011-06-12 18:19:22 +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
Guillermo Iguaran
657ba2a9f0 Remove trailing whitespaces 2011-06-12 10:31:21 -05: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
Ken Collins
c791e2d034 Allow the connection pool's #table_exists? method to give the connections #table_exists? method a chance. 2011-06-10 13:15:58 -04: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
Brian Quinn
9f2e91414f Ensure engine migrations are copied in the same sequence that they are required. 2011-06-10 12:11:45 +01:00
Damien Mathieu
84f71e42b7 don't reinitialize the arel_table unless the table_name changes 2011-06-09 14:56:07 -07: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
Jon Leighton
e48829946d Update the RUNNING_UNIT_TESTS file 2011-06-09 20:20:51 +01:00
José Valim
af3f0b6204 Merge pull request #1591 from smartinez87/unused
Fix "warning: assigned but unused variable" on AR tests
2011-06-08 23:36:49 -07:00
Sebastian Martinez
9af4e803ec Remove unused 'y' variable. 2011-06-08 23:13:59 -03:00
Sebastian Martinez
0b86ac244c Remove unused 'quoted_column_names' variable. 2011-06-08 23:13:43 -03:00
Rodrigo Navarro
8166e4b0c3 No need to create a new Arel::Table, as the arel_table method already creates a new one 2011-06-08 16:56:01 -03:00
Raimonds Simanovskis
e58ee1dccc Do not hardcode :id as it was ignored by mass assignment filter
As a result test was failing on Oracle where ids are assigned by default from 1000
2011-06-08 11:56:23 +03:00
Santiago Pastorino
1d3618a9b4 remove warning: assigned but unused variable 2011-06-08 00:26:09 -03:00
Jon Leighton
7d1782a2c1 Allow polymorphic has_one to work when the association is set before the owner has been saved. Fixes #1524. 2011-06-08 00:32:49 +01:00
Jon Leighton
4f5f6a3257 When you add a record to a polymorphic has_one, you should be able to access the owner from the associated record 2011-06-08 00:32:49 +01:00
Alexandr Zykov
4c3ec9889a fix typo 2011-06-08 03:31:33 +06:00
Dmitriy Kiriyenko
8aabefb0b7 This way asserting that updated_at was changed in touch look more obvious. 2011-06-07 18:42:40 +01:00
Dmitriy Kiriyenko
7c1f73c843 Do not use default_scope in ActiveRecord::Persistence#touch. 2011-06-07 18:42:40 +01:00
Jon Leighton
ad9586bf38 Fix a couple of helper requires that were missed. This was causing the tests to fail to run on 1.8.7. 2011-06-07 08:35:55 +01:00
José Valim
e32e8ed966 Merge pull request #1474 from ganeshkumar/update_column_changes
added  tests for update_column
2011-06-07 00:14:42 -07:00
Aaron Patterson
80451a1fa6 make sure AR isolated tests set the environment variable 2011-06-06 18:01:45 -07:00
Aaron Patterson
cd27cd5e49 oops! add parens so the block is properly bound 2011-06-06 17:00:08 -07:00
Aaron Patterson
8392f10b58 set the environment variable from the rake file 2011-06-06 16:51:45 -07:00
Aaron Patterson
424cf3b050 more oracle fixes 2011-06-06 15:47:29 -07:00
Aaron Patterson
517ca8771c do not muck with the load path, that is the test task responsibility 2011-06-06 15:47:26 -07:00
Aaron Patterson
841d29639b updating configs for oracle 2011-06-06 15:47:22 -07:00
Aaron Patterson
c8d124c0fc add test to the include path 2011-06-06 15:47:17 -07:00
Aaron Patterson
61774e0d49 please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT 2011-06-06 15:47:13 -07:00
Jon Leighton
499dec0102 Make sure that the build/drop database rake tasks take account of the test/config.yml config 2011-06-06 21:27:28 +01:00
Xavier Noria
5e21247131 Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	activerecord/RUNNING_UNIT_TESTS
2011-06-06 22:23:30 +02:00
Xavier Noria
689e12b828 Revert "updated Changelog "
This reverts commit 79990505e5080804b53d81fec059136afa2237d7.

Conflicts:

	activerecord/CHANGELOG

Reason: Sorry, CHANGELOGs can't be edited via docrails.
2011-06-06 22:12:34 +02:00
Vijay Dev
5d8df14d6d comment the recorder methods 2011-06-07 01:38:03 +05:30
Vijay Dev
428883b579 up and down are no longer class methods in a migration 2011-06-07 01:23:08 +05:30
Guillermo Iguaran
c2c8ef57d6 Remove trailing white-spaces 2011-06-05 10:34:40 -05:00
Anil Wadghule
3fc53e5ea1 Fix failing test because of Timezone difference. 2011-06-05 19:36:37 +05:30
Jon Leighton
523c7c2330 Fix adapter_test.rb to make no assumptions about the database name 2011-06-05 11:28:17 +01:00
Jon Leighton
3b7d100b51 Fix typo 2011-06-05 11:28:17 +01:00
José Valim
b5b31658bc Merge pull request #1462 from arunagw/test_added_for_namedscope
Test added for namedscope target.
2011-06-05 00:12:05 -07:00
Jon Leighton
75e56101d4 Bring back oracle specific crap 2011-06-04 23:49:54 +01:00
Jon Leighton
253bb6b926 Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases. 2011-06-04 23:47:03 +01:00
Waynn Lue
6fbd548b5f add a missing "the" and normalize the use of periods. 2011-06-03 12:26:53 -07:00
Prem Sichanugrist
74f9a4629b Revise documentation indentation from [79990505e5080804b53d81fec059136afa2237d7] 2011-06-03 15:06:03 -04:00
ganesh
79990505e5 updated Changelog 2011-06-04 00:31:45 +05:30
ganesh
5f66f7a9a2 added more tests for update_column 2011-06-04 00:04:59 +05:30
Andrew White
54883682de Don't double assign attributes - closes #1467. 2011-06-03 13:57:00 +01:00
Arun Agrawal
0695eb6dac Test added for namedscope target. 2011-06-03 08:28:00 +05:30
Jon Leighton
f064664de7 Fix broken test. You know, the merge button will be the end of us... 2011-06-01 23:13:40 +01:00
Vijay Dev
6e02164e02 styling changes 2011-06-02 01:08:14 +05:30
Ayose
196c8f13bf Edited activerecord/lib/active_record/transactions.rb via GitHub 2011-06-01 12:36:16 -07:00
Aaron Patterson
63665f6c9f Merge pull request #1385 from smartinez87/drop
#drop_table accepts no options now.
2011-06-01 10:52:41 -07:00
Arun Agrawal
7d447c4726 Adding comment 2011-06-01 18:50:43 +01:00
Vishnu Atrai
230f788759 AttributeMethodTest test fix #jruby 2011-06-01 18:50:26 +01:00
Brian Mathiyakom
1e43bd9f35 Fix issue #1272
Set reverse_order_value when asked to reverse_order().
Do the actual reversal in build_arel.
2011-06-01 18:29:29 +01:00
Ayose
3523144ea4 The URL http://dev.mysql.com/doc/refman/5.0/en/savepoints.html is no longer available 2011-06-01 08:47:06 -07:00
Jon Leighton
69c52b0e9a Add missing require to fix the CI 2011-06-01 08:58:50 +01:00
Prem Sichanugrist
2aaeac9a0a Isolated PostgreSQL test into PostgreSQL folder 2011-05-31 20:56:07 -04:00
Andrew White
cf3364a03c Raise NameError instead of ArgumentError in ActiveSupport::Dependencies
ActiveSupport::Dependencies now raises NameError if it finds an existing
constant in load_missing_constant. This better reflects the nature of
the error which is usually caused by calling constantize on a nested constant.

Closes #1423
2011-06-01 01:16:20 +01:00
Josh Kalderimis
eb7ef2ccd6 added an alias for new to build to the AR collection proxy, this corrects an issue where the collection proxies were not consistent 2011-06-01 00:01:35 +01:00
Jon Leighton
4067d88df5 Revert "[activerecord][postgresql] verify if table has a schema(not public)". This caused a test breakage. See #1410 for details.
This reverts commit c44418ea4e09cc81da47edbc9ac5f31c7e32c1b4.
2011-05-31 22:46:13 +01:00
Jon Leighton
fbe012e92d Ensure that calculations properly override the select value even if it's set in the default scope. Fixes #1395. 2011-05-31 21:12:20 +01:00
Erik Fonselius
a5806fa409 Failing test for aggregating on default_scope with select 2011-05-31 20:47:30 +01:00
Jon Leighton
dfaad4f5a7 Only save the record once when calling create! on a collection association. Fixes #1360. 2011-05-31 20:32:09 +01:00
Farley Knight
aa316e27b7 Tests for issue #1360 2011-05-31 19:47:34 +01:00
Jon Leighton
60cb96abea Implementing @dmathieu's cleaner fix from #1425. Unfortunately he deleted the branch so I cannot just merge it. 2011-05-31 18:34:27 +01:00
Jon Leighton
0bb8429e71 Reduce test noise 2011-05-31 18:18:14 +01:00
Arun Agrawal
e04f2c1d42 Opening class CascadedEagerLoadingTest at once. 2011-05-31 12:35:37 +05:30
Arun Agrawal
2e57b66931 Adding comment to work with 1.8.7. Nested Attribute fix. 2011-05-31 12:12:19 +05:30
Arun Agrawal
cfb5f1b608 Fix nested attribute for memory record. 2011-05-31 11:31:10 +05:30
Aaron Patterson
7278547a5d Merge pull request #1410 from lucasts/pg_schema
a little step to better postgresql schema support in rails
2011-05-30 13:30:07 -07:00
Lee Reilly
4f234bfd79 Corrected some typos and American vs. Queen's English issues 2011-05-29 12:40:24 -07:00
Sebastian Martinez
802555a5cd #drop_table accepts no options now. 2011-05-28 18:19:32 -03:00
Aaron Patterson
18b153d15d Merge pull request #1384 from amatsuda/simplify_drop_table
Remove unused options from drop_table
2011-05-28 13:36:40 -07:00
Akira Matsuda
bcb466c543 No need to pass options which is never used 2011-05-29 04:30:22 +09:00
Akira Matsuda
d8f4988867 No need to override for just calling super 2011-05-29 04:29:19 +09:00
Vijay Dev
995ea00328 Use change in place of up and down in sessions table migration 2011-05-28 21:59:54 +05:30
Akira Matsuda
9fb51e76fd Disable IdentityMap by default for ActiveRecord testing
because enabling IM by default will possibly hide some bugs on 3.1 default behavior
2011-05-28 09:08:13 +09:00
Aaron Patterson
c122c7b271 stop using boolean expressions because of the side effects 2011-05-27 14:53:20 -07:00
Aaron Patterson
4b536f7591 Merge pull request #1365 from gnufied/sqlite3
close statment only if its not closed
2011-05-27 14:40:32 -07:00
Aaron Patterson
2a9b3abe19 Merge pull request #1229 from workmad3/master
Fix for Issue #1205
2011-05-27 14:34:05 -07:00
Hemant Kumar
ed1a0672ab delegate connection and column_hash calls directly to model 2011-05-28 03:00:11 +05:30
Hemant Kumar
d48add714d close statment only if its not closed 2011-05-28 02:57:36 +05:30
Aaron Patterson
985ace4d7f work around bug in the sqlite3 bindings. fixes #1289 2011-05-27 14:12:28 -07:00
Lucas Stephanou
c44418ea4e [activerecord][postgresql] verify if table has a schema(not public) 2011-05-27 17:48:34 -03:00
Lucas Stephanou
055c6fb010 find sequences with pg schemas properly 2011-05-27 16:39:19 -03:00
Aaron Patterson
8628948e2a fixing test for mysql2 2011-05-27 11:44:14 -07:00
Aaron Patterson
d1c74706c3 adding a test for #1322 2011-05-26 16:16:57 -07:00
Sebastian Martinez
dfba8f544b Fix font styling on associations.rb 2011-05-26 17:51:20 -03:00
Jon Leighton
602fff1f58 Merge pull request #1323 from fx/association_primary_key
use association_primary_key in AssociationScope#add_constraints
2011-05-26 13:08:10 -07:00
Jon Leighton
09e431aa89 Merge pull request #1318 from TheEmpty/master
Resolve issue #534
2011-05-26 12:54:38 -07:00
Mohammad Typaldos
ded7e35cb0 Removes a now needless test - via Github 2011-05-26 12:17:20 -07:00
John Mileham
043b624390 Don't merge base opts into includes when serializing ARs
Conflicts:

	activerecord/lib/active_record/serialization.rb
2011-05-26 11:40:57 -04:00
Tekin
52f0437af1 Correct TESTOPTS specification in activerecord/RUNNING_UNIT_TESTS 2011-05-26 16:24:44 +01:00
John Mileham
294e2a8c2e Failing test - JSON serialization shouldn't merge base opts into include opts. 2011-05-26 11:24:25 -04:00
Marian Rudzynski
f4ed56df43 added assertion for non-standard primary_key on models used in the primary_key test 2011-05-26 12:40:09 +02:00
Marian Rudzynski
1f7c3d0264 use association_primary_key in AssociationScope#add_constraints 2011-05-26 11:00:27 +02:00
Mohammad El-Abid
ec44763f03 Removes the restriction on primary key when joining in a habtm && test that it was properly removed 2011-05-26 00:54:51 -04:00
Xavier Noria
b7921f50e7 Merge branch 'master' of github.com:rails/rails 2011-05-25 22:49:23 +02:00
Xavier Noria
00e1d0832e Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	actionmailer/lib/action_mailer/base.rb
	activesupport/lib/active_support/core_ext/kernel/requires.rb
2011-05-25 22:48:47 +02:00
Aaron Patterson
6b436c23a9 Merge pull request #1285 from joshk/remove_active_record_deprecations
removed deprecated methods, and related tests, from ActiveRecord
2011-05-25 13:48:35 -07:00
Franck Verrot
64d977359d Add the MIT-LICENSE to the Active Record gemspec 2011-05-25 15:32:04 +02:00
Franck Verrot
b2db8740ea Fix the AR::Base#inspect method [closes #1294] 2011-05-25 13:54:38 +02:00
Franck Verrot
bf159aa5fc Test AR::Base#inspect on an allocated object not yet initialized 2011-05-25 13:53:51 +02:00
Arun Agrawal
5d89675099 Database.rake file fixed for load_generators 2011-05-25 13:57:44 +05:30
Josh Kalderimis
542114e1d8 removed deprecated methods, and related tests, from ActiveRecord 2011-05-25 02:29:32 +02:00
José Valim
52e01fc59d Everyone receives app as argument for consistency. 2011-05-25 01:37:55 +02:00
Jon Leighton
c69111ba5f Fix infinite recursion where a lazy default scope references a scope. Fixes #1264. 2011-05-25 00:08:14 +01:00
Jon Leighton
ce37f747cd Merge pull request #1254 from pixeltrix/ignore-includes-in-through-scope
Ignore :includes on through associations
2011-05-24 15:34:28 -07:00
Jon Leighton
a000ff7a50 Ensure that the surrounding code in Relation#to_a respects the default_scope (as well as having Relation#arel respect the default scope). Fixes #1233. 2011-05-24 23:29:44 +01:00
Andrew White
f1f1ab77df Failing tests for #1233. 2011-05-24 23:25:21 +01:00
José Valim
36991f195b Merge pull request #1274 from vijaydev/rake-packagetask-warning-fix
Fixes for Rake::GemPackageTask deprecation warnings from Rake 0.9.0
2011-05-24 12:14:30 -07:00
Aaron Patterson
176883a906 rescue record invalid exceptions and return false from the save method. fixes #796 2011-05-24 11:22:11 -07:00
Aaron Patterson
559d809609 add tests surrounding behavior of save and save! for associations that have validation errors 2011-05-24 11:21:24 -07:00
Vijay Dev
79e9a2983a fixes Rake::GemPackageTask deprecation warnings from rake 0.9.0 2011-05-24 23:39:24 +05:30
Aaron Patterson
964338777d adding a test for create! with invalid associations 2011-05-24 11:06:36 -07:00
Aaron Patterson
0df8830160 do not bother with assert_nothing_raised, the test will fail and we get a better trace without it 2011-05-24 11:05:36 -07:00
Joey Butler
e106dbf039 Add failing test case for issue 796 2011-05-24 10:59:37 -07:00
Jeremy Friesen
f2a0dfc298 Addresses an inconsistency in the ActiveRecord::Base.method_missing handling of dynamic finder methods and the passing of the &block parameter for :find_by_attributes. 2011-05-24 13:52:48 -04:00
David Workman
06436b2cad Added a test to check for correct behaviour with no options in add_index command recorder 2011-05-24 17:06:40 +01:00
Karunakar (Ruby)
bfb9f758ae changed http://api.rubyonrails.com to http://api.rubyonrails.org in readme files 2011-05-24 21:12:01 +05:30
dmathieu
79dc275b8d properly reference yml alias nodes
as per the last version of the yml specifications : http://www.yaml.org/spec/1.2/spec.html#* alias//
2011-05-24 11:18:28 +02:00
Andrew White
d8bd19f6ab Ignore :includes on through associations 2011-05-24 07:21:32 +01:00
Sebastian Martinez
0034b7822d Remove extra white spaces on ActiveRecord docs. 2011-05-23 20:58:25 -03:00
Sebastian Martinez
05f29ca2c9 Remove extra white-space on some exception messages. 2011-05-23 20:53:18 -03:00
Aaron Patterson
5ec23b95ba fixing 1.8 support for new fixture tests 2011-05-23 15:06:13 -07:00
Aaron Patterson
1716da0720 removing CSV fixture support 2011-05-23 15:06:12 -07:00
Aaron Patterson
081b36c6ce fixture file will validate fixture format 2011-05-23 15:06:12 -07:00
Aaron Patterson
5278af3d8e return an empty array for empty yaml files 2011-05-23 15:06:12 -07:00
Aaron Patterson
74c5f65bfb use top level file constant for join, etc 2011-05-23 15:06:12 -07:00
Aaron Patterson
ad3f0eec75 adding AR::Fixtures::File class to wrap a fixture file 2011-05-23 15:06:12 -07:00
David Workman
86afbf7464 Using .try to test for the existence of a method option in a nil-resistent manner. Inlined the determination of the options hash for reversing using a ternary operator. Shortens the method in a way that keeps the code neat 2011-05-23 22:33:03 +01:00
David Workman
8588dd431b Neatened up the invert_add_index method as per suggeston 2011-05-23 15:03:42 +01:00
Josh Kalderimis
eff5d9aed4 Removed AS core_ext/kernel/requires as it's not used and is bad practice. 2011-05-23 15:31:33 +02:00
David Workman
a7fad65792 Simple fix for correctly inverting an add_index migration when a name has been provided 2011-05-23 13:54:51 +01:00