Commit Graph

2873 Commits

Author SHA1 Message Date
Jon Leighton
04d238bfb5 Fix adapter_test.rb to make no assumptions about the database name 2011-06-05 11:29:05 +01:00
Jon Leighton
6925423b26 Fix typo 2011-06-05 11:28:58 +01:00
Jon Leighton
550064cbde Bring back oracle specific crap 2011-06-04 23:50:06 +01:00
Jon Leighton
f9e3d4bc59 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:25:36 +01:00
Jon Leighton
03d087d4df Fix broken test. You know, the merge button will be the end of us... 2011-06-01 23:14:09 +01:00
Arun Agrawal
7f34d5bc0b Adding comment 2011-06-01 18:51:03 +01:00
Vishnu Atrai
26d0f42f18 AttributeMethodTest test fix #jruby 2011-06-01 18:51:03 +01:00
Brian Mathiyakom
8a4013ddd0 Fix issue #1272
Set reverse_order_value when asked to reverse_order().
Do the actual reversal in build_arel.
2011-06-01 18:30:14 +01:00
Andrew White
f1fe3c2d52 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:12:41 +01:00
Jon Leighton
668767091f Merge pull request #1437 from joshk/ar_collection_new_alias
Ar collection new alias
2011-05-31 15:48:13 -07:00
Josh Kalderimis
22b02cb049 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:42:02 +02:00
Jon Leighton
f4e3b70e9c Ensure that calculations properly override the select value even if it's set in the default scope. Fixes #1395. 2011-05-31 21:12:40 +01:00
Erik Fonselius
c22364b60d Failing test for aggregating on default_scope with select 2011-05-31 21:12:40 +01:00
Farley Knight
842043e352 Tests for issue #1360 2011-05-31 20:32:47 +01:00
Akira Matsuda
37304e3be9 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 20:59:33 +09:00
Aaron Patterson
c0c9a336be fixing test for mysql2 2011-05-27 11:45:49 -07:00
Aaron Patterson
37b2104109 adding a test for #1322 2011-05-27 11:45:32 -07:00
Jon Leighton
b519b0cac9 Fix infinite recursion where a lazy default scope references a scope. Fixes #1264. 2011-05-25 00:18:08 +01:00
Andrew White
8a4263c957 Ignore :includes on through associations 2011-05-25 00:17:53 +01:00
Andrew White
0daf574648 Failing tests for #1233. 2011-05-25 00:17:00 +01:00
Aaron Patterson
1d864e823a add tests surrounding behavior of save and save! for associations that have validation errors 2011-05-24 11:26:49 -07:00
Aaron Patterson
b102e60bf5 adding a test for create! with invalid associations 2011-05-24 11:26:44 -07:00
Aaron Patterson
d48563352f do not bother with assert_nothing_raised, the test will fail and we get a better trace without it 2011-05-24 11:26:39 -07:00
Joey Butler
177666ebcf Add failing test case for issue 796 2011-05-24 11:26:34 -07:00
Jon Leighton
872a9c1b50 Fix problem with loading polymorphic associations which have been defined in an abstract superclass. Fixes #552. 2011-05-23 20:30:26 +01:00
Santiago Pastorino
da8469fa7d Merge pull request #1187 from thedarkone/polymorphic-class-fix
Handle polymorphic_type NOT NULL columns
2011-05-21 09:43:42 -07:00
Andrew White
09daaaa1e0 Add support for passing mass assignment roles to dynamic finders. Closes #1170. 2011-05-21 16:33:54 +01:00
thedarkone
1c614bcb0f Handle polymorphic_type NOT NULL-able columns as well. 2011-05-21 15:18:09 +02:00
Guillermo Iguaran
23e94a67f8 Refactoring test_has_many_with_pluralize_table_names_false test 2011-05-20 01:53:13 -05:00
Guillermo Iguaran
6a3b3fba5a Allow pluralize_table_names for individual model 2011-05-20 01:44:13 -05:00
Jon Leighton
0afd5850f5 Implement proxy_owner, proxy_target and proxy_reflection methods on CollectionProxy with deprecations. Fixes #1148. 2011-05-19 23:28:44 +01:00
Andrew White
3773aa4fbb Add block setting of attributes to singular associations 2011-05-17 22:16:24 +01:00
Andrew White
42f1ad6865 Pass the attribute and option hashes to build_association
The build_association method was added as an API for plugins
to hook into in 1398db0. This commit restores this API and the
ability to override class.new to return a subclass based on
a virtual attribute in the attributes hash.
2011-05-17 20:43:30 +01:00
Arun Agrawal
ed119aa5d6 Fixed InnerJoinAssociationTest. Need to load essays fixture. 2011-05-17 20:29:28 +05:30
Guillermo Iguaran
2c89ed9ad6 Adding missing require 2011-05-16 22:22:27 -05:00
Jon Leighton
2033ff825b Merge pull request #560 from guilleiguaran/fix_pluralize_table_names_false
Fixing has_many when ActiveRecord::Base.pluralize_table_names is false
2011-05-16 15:40:12 -07:00
Prem Sichanugrist
5ca67eca21 Add ActiveRecord::attribute_names to retrieve a list of attribute names. This method will also return an empty array on an abstract class or a model that the table doesn't exists. 2011-05-15 19:07:40 -04:00
Guillermo Iguaran
ecbde46e57 Fixing has_many association when ActiveRecord::Base.pluralize_table_names is false. fixes #557 2011-05-15 03:53:10 -05:00
Jon Leighton
60b23ea1da CollectionAssociation#merge_target_lists should write to the underlying attributes when copying, rather than using the assignment method 2011-05-14 19:49:22 +01:00
Aaron Patterson
ce1a1b47be supporting infinity and -infinity for timestamps in PG. fixes #544 2011-05-13 13:04:44 -07:00
Jon Leighton
6e466f17c3 Don't use mass-assignment protection when setting foreign keys or association conditions on singular associations. Fixes #481 (again). 2011-05-12 23:29:22 +01:00
Josh Kalderimis
a0000d0ea0 updated AR#create! to accept an options hash so the mass-assignment security role can be passed in, also updated the Changelog to mention the change to some of the AR method signatures. 2011-05-12 09:24:42 +02:00
Jon Leighton
d192d85668 Merge pull request #512 from pivotalneutron/fix_eager_load_with_calculations
Bug fixes for calculations with includes
2011-05-11 13:32:04 -07:00
Fadzril Muhamad & Joseph Palermo
1db49ced45 Bug fixes:
- If doing a count on a relation that has an :include and a :join, it does a distinct even though it should not.
- When doing a count on a relation that has an :include, it always falls back to a old style left join when performing the count.  Looks like it was broken here:
b9599502c9
2011-05-12 04:05:24 +08:00
Santiago Pastorino
c53d3929cd Add missing requires 2011-05-11 13:05:04 -03:00
knapo
bb498a5749 Fix assigning protected attributes by attributes= 2011-05-11 17:17:42 +02:00
Andrew White
0fde84c0f8 Don't remove the target if it has already been destroyed 2011-05-11 14:22:22 +01:00
Michael Ebens
940c31f9de Modified NamedScopeTest to use CollectionAssociation. 2011-05-11 03:37:35 -07:00
Jon Leighton
1dd90f8f12 Don't use select() values from the join model of a through association. Fixes #508. 2011-05-11 08:56:01 +01:00
Jon Leighton
aa1fc1c88c Bring back obj.association_loaded? as a deprecated method. Fixes #472. 2011-05-11 08:56:01 +01:00