Josh Susser
5214e73850
add #first! and #last! to models & relations
2011-03-24 09:55:51 -07:00
Adam Meehan
c5908a8649
Fix before_type_cast for timezone aware attributes by caching converted value on write. Also remove read method reload arg on timezone attributes.
2011-03-23 15:38:51 -07:00
Murray Steele
54c963c89b
Make clearing of HABTM join table contents happen in an after_destory callback.
...
The old method of redefining destroy meant that clearing the HABTM join table would happen as long as the call to destroy succeeded. Which meant if there was a before_destroy that stopped the instance being destroyed using normal means (returning false, raising ActiveRecord::Rollback) rather than exceptional means the join table would be cleared even though the instance wasn't destroyed. Doing it in an after_destroy hook avoids this and has the advantage of happening inside the DB transaction too.
2011-03-23 14:45:21 -07:00
Murray Steele
8ee81d21fb
Failing test case to show that habtm join table contents are removed when a model is destroyed but the destruction is blocked by a before_destroy.
2011-03-23 14:45:21 -07:00
Xavier Noria
3b91b3726d
Merge branch 'master' of git://github.com/lifo/docrails
2011-03-23 21:52:33 +01:00
Santiago Pastorino
450f7cf01b
use class_eval with a string when it's possible
2011-03-22 20:11:36 -03:00
Santiago Pastorino
baa237c974
Allow to read and write AR attributes with non valid identifiers
2011-03-22 20:02:32 -03:00
Santiago Pastorino
da6c7bd4b4
Do not in place modify what table_name returns
2011-03-22 19:36:16 -03:00
Aaron Patterson
ed97c39517
adding missing require
2011-03-22 10:10:33 -07:00
Aaron Patterson
2ef6270f8f
Merge branch 'master' into fuuu
...
* master:
Do not show optional (.:format) block for wildcard route [#6605 state:resolved]
pushing id insertion and prefetch primary keys down to Relation#insert
use prepared statements to fetch the last insert id
escaping binary data encoding when inserting to sqlite3. Thanks Naruse! [#6559 state:resolved]
schemas set by set_table_name are respected by the mysql adapter. [#5322 state:resolved]
Reapply extensions when using except and only
SJIS is an alias to Windows-31J in ruby trunk. Use SHIFT_JIS for this test
Improved resolver docs a bit
[action_view] docs for FileSystemResolver
[action_view] added custom patterns to template resolver
2011-03-22 09:34:33 -07:00
Aaron Patterson
15d3cc21f4
pushing id insertion and prefetch primary keys down to Relation#insert
2011-03-22 09:18:01 -07:00
Aaron Patterson
3378d77b04
use prepared statements to fetch the last insert id
2011-03-21 16:32:13 -07:00
Aaron Patterson
88636f7195
escaping binary data encoding when inserting to sqlite3. Thanks Naruse! [ #6559 state:resolved]
2011-03-21 14:49:07 -07:00
Aaron Patterson
ea8fcfb729
schemas set by set_table_name are respected by the mysql adapter. [ #5322 state:resolved]
2011-03-21 11:20:45 -07:00
Iain Hecker
96b9fc4400
Reapply extensions when using except and only
2011-03-21 10:29:45 -07:00
Jon Leighton
5b84aebd14
Add order clauses to fix some tests which were failing under 1.8 on oracle and postgres
2011-03-18 23:14:45 +00:00
Paco Guzman
f3666040a0
remove bank line
2011-03-18 11:29:52 +01:00
Jon Leighton
8aaf3c1e55
Merge branch 'master' into nested_has_many_through
2011-03-16 18:54:51 +00:00
Jon Leighton
9abc94c445
oracle, y u defy me
2011-03-16 18:54:34 +00:00
Manuel Meurer
64fe0d4cba
Remove incorrect comment that a default value of NULL cannot be set with change_column_default.
2011-03-16 11:01:43 +07:00
Xavier Noria
21b12d89a6
Merge branch 'master' of git://github.com/lifo/docrails
2011-03-14 22:09:52 +01:00
Anders Elfving
9b64399684
Adjust unique constraint comment to include info about the RecordNotUnique exception
2011-03-13 11:49:56 +01:00
Andrew White
47871b025e
Remove invalid test
...
The test fails on PostgreSQL when trying to load the records as
the comments_count field is not included in the GROUP BY clause.
2011-03-13 08:43:19 +00:00
Chris Oliver
015192560b
Fixed a bug when empty? was called on a grouped Relation that wasn't loaded
...
[#5829 state:resolved]
Signed-off-by: Andrew White <andyw@pixeltrix.co.uk >
2011-03-12 22:31:21 +00:00
Mike Gehard
58de03f077
Add additional text to NotImplementedErrors [ #6328 state:resolved]
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-03-12 13:43:23 -02:00
Jon Leighton
37d93ea160
Fix tests under postgres - we should always put conditions in the WHERE part not in ON constraints because postgres requires that the table has been joined before the condition references it.
2011-03-12 09:32:20 +00:00
Jon Leighton
02a43f9f45
Resolve some TODO comments which I decided did not need anything done
2011-03-12 08:42:57 +00:00
Paco Guzman
0a51e43866
remove some blanks
2011-03-11 23:08:55 +01:00
Jon Leighton
39a6f4f25d
Simplify implementation of ThroughReflection#chain
2011-03-11 00:51:57 +00:00
Jon Leighton
e18679ab04
Abstract some common code from AssociationScope and JoinDependency::JoinAssociation into a JoinHelper module
2011-03-11 00:47:18 +00:00
Jon Leighton
aef3629c6e
Refactor JoinAssociation
2011-03-10 23:55:29 +00:00
Jon Leighton
582edaa1ff
Merge branch 'master' into nested_has_many_through
2011-03-10 19:35:20 +00:00
Jon Leighton
2d3d9e3531
Rename Reflection#through_reflection_chain and #through_options to Reflection#chain and Reflection#options as they now no longer relate solely to through associations.
2011-03-10 19:28:26 +00:00
Jon Leighton
6490d65234
Move the code which builds a scope for through associations into a generic AssociationScope class which is capable of building a scope for any association.
2011-03-10 19:04:00 +00:00
Xavier Noria
f41dd99be7
revises links to the API websites of individual components (no longer maintained), and rewrites the section about after and around filters in the controller guide
2011-03-09 07:43:18 +01:00
Xavier Noria
89ecc0a5dc
Merge branch 'master' of git://github.com/lifo/docrails
2011-03-07 22:11:47 +01:00
Jon Leighton
bb063b2f1b
Fix test_has_many_association_through_a_has_many_association_with_nonstandard_primary_keys
2011-03-07 20:58:32 +00:00
Jon Leighton
532f915037
Referencing a table via the ON condition in a join should force that table to be eager-loaded via a JOIN rather than via subsequent queries.
2011-03-07 08:51:17 -08:00
Jon Leighton
cee3f9b36d
Referencing a table via the ON condition in a join should force that table to be eager-loaded via a JOIN rather than via subsequent queries.
2011-03-07 00:04:20 +00:00
Jon Leighton
5dc1fb39dd
Refactor ThroughAssociation#join_to to be much smaller, and independent of construct_owner_conditions.
2011-03-06 23:38:10 +00:00
Akira Matsuda
5bed37779a
"SSL everywhere" for GitHub URLs
...
see: https://github.com/blog/738-sidejack-prevention-phase-2-ssl-everywhere
2011-03-07 05:56:02 +09:00
Jon Leighton
d02c326a8b
Refactor ThroughAssociation#tables to just be a flat array of tables in the order that they should be joined together.
2011-03-06 18:14:39 +00:00
Jon Leighton
28ed10d3f2
Merge branch 'master' into nested_has_many_through
...
Conflicts:
activerecord/CHANGELOG
2011-03-05 22:58:48 +00:00
Jon Leighton
b7f1b3641a
Use Base#type_condition in JoinAssociation
2011-03-05 22:32:49 +00:00
Jon Leighton
7fddb94262
Push source_type and polymorphic conditions out of ThroughAssociation and JoinDependency::JoinAssociation and into the reflection instead.
2011-03-05 22:07:30 +00:00
Jon Leighton
ddf83d14f1
Add a test for STI on the through where the through is nested, and change the code which support this
2011-03-05 20:10:24 +00:00
Aaron Patterson
74818a3543
use Arel::Table#alias rather than passing the :as parameter
2011-03-05 11:56:24 -08:00
R.T. Lechow
a1b4d8e7b2
Active Record typos.
2011-03-05 11:56:34 +01:00
mjy
045ca30394
fixes a missmatched column in example
2011-03-05 11:56:33 +01:00
Xavier Noria
3b10b8a201
implements ActiveRecord::Base.connection_config to be able to check the configuration of the current connection at runtime
2011-03-05 01:35:02 +01:00