David Heinemeier Hansson
3566be4728
Fixed that eager loading queries and with_scope should respect the :group option [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7355 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-21 21:58:38 +00:00
David Heinemeier Hansson
0e452bb02d
Fixed that eager loading queries should respect the :group option as well [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7354 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-21 21:29:21 +00:00
Michael Koziarski
29b0707f07
Improve performance and functionality of the postgresql adapter. Closes #8049 [roderickvd]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-16 06:26:30 +00:00
Michael Koziarski
f008566d65
Don't clobber :includes passed to count on has_many association. Closes #9175 [danger]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-16 04:37:31 +00:00
Michael Koziarski
82b244e3ff
Make sure has_many associations honour :include when counting. Closes #9167 [danger]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7325 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-16 04:36:55 +00:00
Michael Koziarski
5b801b5960
Change the implementation of ActiveRecord's attribute reader and writer methods:
...
* Generate Reader and Writer methods which cache attribute values in hashes. This is to avoid repeatedly parsing the same date or integer columns.
* Move the attribute related methods out to attribute_methods.rb to de-clutter base.rb
* Change exception raised when users use find with :select then try to access a skipped column. Plugins could override missing_attribute() to lazily load the columns.
* Move method definition to the class, instead of the instance
* Always generate the readers, writers and predicate methods.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-14 08:53:02 +00:00
Michael Koziarski
d4bf5e9b34
Make habtm respect the :select option. Closes #9207 . [Aleksey Kondratenko]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7279 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-07 09:53:33 +00:00
Michael Koziarski
bb94ce92fc
Let inspect on AR classes work when the table doesn't exist. Closes #9194 [tarmo, nzkoz]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7278 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-06 00:18:50 +00:00
Michael Koziarski
c4c6662498
Performance enhancement for Base.exists?. CLoses #8769 . [hasmanyjosh]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7274 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-05 00:57:43 +00:00
Rick Olson
ea07212d97
dont call #collect on a string when returning query cache results. Closes #9099 [norbert]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7239 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-25 13:05:58 +00:00
Rick Olson
f5ea6f880f
Perform a deep #dup on query cache results so that modifying activerecord attributes does not modify the cached attributes. [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7238 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-25 03:48:30 +00:00
Rick Olson
d51e7f8252
Ensure that has_many :through associations use a count query instead of loading the target when #size is called. Closes #8800 [lifo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7237 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-25 03:09:21 +00:00
Rick Olson
b49fcde7e5
tiny doc patches [lifo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7236 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-25 03:05:55 +00:00
Rick Olson
2d7afe4456
misc doc fixes + Add ActiveResource to Rails::Info. Closes #8741 , #9008 , #9089 [kampers]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7235 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-25 02:50:35 +00:00
David Heinemeier Hansson
edd68a587f
Refactored in use of extract_options! ( closes #9079 ) [josh]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7220 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-24 16:48:57 +00:00
David Heinemeier Hansson
1e1f93fd10
Added :unless clause to validations ( closes #8003 ) [monki]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7215 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-24 01:48:17 +00:00
Rick Olson
3029a76af3
Fix #count on a has_many :through association so that it recognizes the :uniq option. Closes #8801 [lifofifo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7199 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-20 00:10:06 +00:00
Rick Olson
a413056407
Fix and properly document/test count(column_name) usage. Closes #8999 [lifofifo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7192 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-17 20:16:35 +00:00
Rick Olson
872c5f4380
Remove deprecated count(conditions=nil, joins=nil) usage. Closes #8993 [lifofifo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7189 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-16 20:26:10 +00:00
Rick Olson
4ef5af8d4d
Change belongs_to so that the foreign_key assumption is taken from the association name, not the class name. Closes #8992 [hasmanyjosh]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7188 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-16 20:21:36 +00:00
Michael Koziarski
816522ecd8
Make create! on a has_many :through association return the association object. Not the collection. Closes #8786 [lifofifo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7182 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-11 23:54:43 +00:00
Tobias Lütke
187e1f85d0
Support for non heterogeneous arrays when serializing to xml. Unless guessable from array name the type name will be included as attribute
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7173 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-09 22:07:39 +00:00
Tobias Lütke
5b2be62934
Make [7169] work as expected with indented XML.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7171 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-09 19:10:45 +00:00
Tobias Lütke
049b1440a3
Include empty has_many/has_and_belongs_to_many associations as empty array tags when serializing to XML
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7169 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-09 18:13:24 +00:00
Michael Koziarski
3fbfc13ee3
Move from select * to select tablename.* to avoid clobbering IDs. Closes #8889 [dasil003]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7167 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-07-07 02:42:42 +00:00
Michael Koziarski
d0ff4ec193
Don't call unsupported methods on associated objects when using :include, :method with to_xml [manfred, jwilger] Closes #7307
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-30 03:31:48 +00:00
Tobias Lütke
817d5d489d
Add the type="array" moniker to has_many / has_and_belongs_to_many associations upon serialization.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7144 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-27 16:37:40 +00:00
Jeremy Kemper
b5b16a80a9
Define collection singular ids method for has_many :through associations. Closes #8763 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7137 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-27 08:19:12 +00:00
Jeremy Kemper
02311a5db1
Array attribute conditions work with proxied association collections. Closes #8318 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7133 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-27 02:56:11 +00:00
David Heinemeier Hansson
08d23d5375
Allow sweepers to be created solely for expiring after controller actions, not model changes [DHH] Added assigns method to ActionController::Caching::Sweeper to easily access instance variables on the controller [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7128 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-26 20:45:41 +00:00
Jeremy Kemper
89c79b8b95
Fix polymorphic has_one associations declared in an abstract class. Closes #8638 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7119 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-25 22:42:19 +00:00
David Heinemeier Hansson
1a0cdf74be
Docfix ( closes #8096 )
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7107 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-23 17:52:50 +00:00
David Heinemeier Hansson
b0391d133a
Docfix ( closes #8674 )
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7101 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-23 17:34:41 +00:00
David Heinemeier Hansson
279113f9b3
Fixed validates_associated should not stop on the first error ( closes #4276 ) [mrj/manfred/josh]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7094 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-23 17:01:00 +00:00
Jeremy Kemper
048dcf31c9
Mock the beginning of the transaction also. References #8642 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7089 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-23 01:58:41 +00:00
Jeremy Kemper
c627590fd4
Rollback if commit raises an exception. Closes #8642 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7088 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-23 00:54:51 +00:00
Jeremy Kemper
989332c734
Save associated records only if the association is already loaded. Closes #8713 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7075 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-21 20:47:26 +00:00
Jeremy Kemper
eb2e30ef24
MySQL: fix show_variable. Closes #8448 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7071 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-20 18:30:35 +00:00
Jeremy Kemper
b94f8e1d29
Remove deprecated quote methods, replaced by quote_value so quote can be used as an attribute name.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7000 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-11 08:06:07 +00:00
Jeremy Kemper
7858a32e1b
Remove deprecated find_first and find_all.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6998 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-11 07:45:56 +00:00
Jeremy Kemper
800b899f96
Remove deprecated push_with_attributes.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6997 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-11 07:15:59 +00:00
Jeremy Kemper
813e8ba93b
Fix Base#inspect when not every attribute is present. Closes #8623 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6995 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-11 05:02:42 +00:00
Jeremy Kemper
9b444fe73b
Rollback [6961] which breaks SQLite tests. Reference #7345 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6965 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-08 01:40:05 +00:00
Jeremy Kemper
869a172a8a
Migrations: raise if a column is duplicated. Closes #7345 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6961 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-07 23:25:50 +00:00
Jeremy Kemper
319107ae40
Migrations: report the number of rows affected when calling insert, update, delete, etc.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6945 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-05 08:21:55 +00:00
Jeremy Kemper
8d6d450303
Fixtures: correctly delete and insert fixtures in a single transaction. Closes #8553 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6944 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-05 04:37:05 +00:00
Jeremy Kemper
673daeabca
Fixtures: people(:technomancy, :josh) returns both fixtures. Closes #7880 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6940 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-05 03:47:02 +00:00
Jeremy Kemper
b05fc40b5d
Calculations support non-numeric foreign keys. Closes #8154 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6919 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-06-01 03:26:51 +00:00
Jeremy Kemper
d0360a4d5c
Base.inspect handles Base itself and abstract_class? Don't use #<Foo ...> since that notation's typically used for instances of a class, not the class itself. Closes #8490 [deepblue]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6913 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-31 17:31:33 +00:00
Jeremy Kemper
8158455ded
Fix an edge case with find with a list of ids, limit, and offset. Closes #8437 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6912 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-31 17:15:56 +00:00
Jeremy Kemper
1edd21bb02
with_scope is protected. Closes #8524 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-30 21:40:55 +00:00
Jeremy Kemper
ff6d2aae0a
Quickref for association methods. Closes #7723 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6905 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-30 07:05:14 +00:00
Jeremy Kemper
1f802968c5
Calculations: return nil average instead of 0 when there are no rows to average. Closes #8298 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6904 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-30 06:57:04 +00:00
Jeremy Kemper
b2681cca2e
acts_as_nested_set: direct_children is sorted correctly. Closes #4761 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6903 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-30 06:34:25 +00:00
Jeremy Kemper
af98d883b9
Raise an exception if both attr_protected and attr_accessible are declared. Closes #8507 , #6004 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6896 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-29 20:35:46 +00:00
Jeremy Kemper
690d6e204a
Typo in PostgreSQL change_column quoting. References #8466 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6891 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-29 08:06:35 +00:00
Jeremy Kemper
c2d14836a1
Missed Oracle rename_column quoting. References #8466 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6890 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-29 07:40:59 +00:00
Jeremy Kemper
69e4cc6e31
SQLite, MySQL, PostgreSQL, Oracle: quote column names in column migration SQL statements. Closes #8466 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6889 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-29 07:21:41 +00:00
Rick Olson
4472a30aad
Allow nil serialized attributes with a set class constraint. #7293 [sandofsky]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6879 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-28 15:51:53 +00:00
Jeremy Kemper
33e96f3cb3
Oracle binary fixtures; pull fixture insertion into the adapters. Closes #7987 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6859 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 06:26:50 +00:00
Jeremy Kemper
d0d5a1fe23
Announce migration versions as they're performed.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6855 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 02:36:55 +00:00
Jeremy Kemper
2be3a33f32
find gracefully copes with blank :conditions. Closes #7599 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6852 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 00:35:49 +00:00
Jeremy Kemper
64d655628c
validates_numericality_of takes :greater_than, :greater_than_or_equal_to, :equal_to, :less_than, :less_than_or_equal_to, :odd, and :even options. Closes #3952 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6850 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 00:30:14 +00:00
Jeremy Kemper
ed2a84f99b
MySQL: create_database takes :charset and :collation options. Charset defaults to utf8. References #8448 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6848 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-26 00:20:37 +00:00
Jeremy Kemper
109926c5a3
Find with a list of ids supports limit/offset. Closes #8437 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6845 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-25 21:56:21 +00:00
Jeremy Kemper
c4a31560bd
Optimistic locking: revert the lock version when an update fails. Closes #7840 . Also return the number of affected rows instead of true.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6843 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-25 21:31:44 +00:00
Jeremy Kemper
38deb0ed83
Migrations: add_column supports custom column types. Closes #7742 . First-patch cheers to jsgarvin\!
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6842 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-25 21:21:41 +00:00
Jeremy Kemper
def61a200e
Call the newly generated read method after generating it. Closes #8470 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6837 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-25 20:55:05 +00:00
Jeremy Kemper
cb7a17a9d0
Load database adapters on demand. Eliminates config.connection_adapters and RAILS_CONNECTION_ADAPTERS. Closes #8456 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6833 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-25 03:19:35 +00:00
Rick Olson
c57c7210cd
Ensure that associations with :dependent => :delete_all respect :conditions option. Closes #8034 [danger, joshpeek, Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6827 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-24 20:39:51 +00:00
Jeremy Kemper
9f51eb2472
Fix :through docs wrecked up by [6777]. Closes #4961 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6817 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-23 06:35:08 +00:00
Jeremy Kemper
4afd6c9f0a
belongs_to assignment creates a new proxy rather than modifying its target in-place. Closes #8412 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6804 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-22 03:39:36 +00:00
Rick Olson
96bc3d224d
Fix column type detection while loading fixtures. Closes #7987 [roderickvd]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6798 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-21 18:54:51 +00:00
Jeremy Kemper
5b414190d0
Document deep eager includes. Closes #6267 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6790 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-19 22:36:36 +00:00
Jeremy Kemper
c7c867ebd2
Revert [4706] which added incorrect docs. References #5684 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6789 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-19 22:15:28 +00:00
Jeremy Kemper
a995b9cde0
Fix #inspect for new records. Closes #8405 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6782 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-19 01:35:19 +00:00
Jeremy Kemper
0f2fd5ab51
belongs_to doesn't go :through. Closes #4961 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6777 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-18 21:51:21 +00:00
Jeremy Kemper
7288fd3e3f
Docs: warn that associations names shouldn't be reserved words. Closes #4378 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6770 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-18 19:18:01 +00:00
Jeremy Kemper
39c64fff8a
Clarify :offset docs. Closes #3733 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6769 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-18 19:06:54 +00:00
Jeremy Kemper
4d753adeaf
Pay tribute to timezones. Tune #inspect style.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6766 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-18 07:24:03 +00:00
Jeremy Kemper
e48b062eed
Sanitize Base#inspect. Closes #8392 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6761 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-18 02:11:43 +00:00
Michael Koziarski
ebbe4fb0d4
Replace the transaction {|transaction|..} semantics with a new Exception ActiveRecord::Rollback. Closes #8030 [Koz]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6754 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-18 01:02:08 +00:00
Jeremy Kemper
9e3a51eb6c
Oracle: extract column length for CHAR also. Closes #7866 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6738 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-15 19:30:19 +00:00
David Heinemeier Hansson
e105e599e7
Sexy dumper now has its groove on ( closes #8281 ) [Chris Wanstrath]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-11 21:26:53 +00:00
Marcel Molina
ca3e89d4de
Document :allow_nil option for validates_acceptance_of since it defaults to true. Closes #8050 . [tzaharia]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6687 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 05:16:41 +00:00
Marcel Molina
6ad9d1dbde
Update documentation for :dependent declaration so that it explicitly uses the non-deprecated API. Closes #8069 . [danger]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6686 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 05:14:37 +00:00
Marcel Molina
ee614d6319
Add documentation caveat about when to use count_by_sql. Closes #8090 . [fearoffish]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6685 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 05:10:19 +00:00
Marcel Molina
15dc567e0f
Also add documentation enhancements for increment_counter. Closes #8092 . [fearoffish]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6684 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 05:08:05 +00:00
Marcel Molina
5bd35705ca
Enhance documentation for decrement_counter. Closes #8093 . [fearoffish]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6683 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 05:06:26 +00:00
Marcel Molina
194b4aa4f3
Provide brief introduction to what optimistic locking is. Closes #8097 . [fearoffish]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6682 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 05:01:31 +00:00
Marcel Molina
6bdcc0cfaf
Add documentation for :encoding option to mysql adapter. Closes #8219 [marclove]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6678 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 04:41:45 +00:00
David Heinemeier Hansson
4cbbebb1c3
Added short-hand declaration style to migrations (inspiration from Sexy Migrations, http://errtheblog.com/post/2381 ) [DHH] Updated resource_scaffold and model generators to use short-hand style migrations [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6667 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-06 01:48:19 +00:00
Michael Koziarski
0c960602fe
Change Base#to_xml to take the name for a container element for an association from the element name, not the first record's class name. Closes #7004
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6654 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-05-03 02:24:50 +00:00
David Heinemeier Hansson
70ac560e42
Removed breakpointer and Binding.of_caller in favor of relying on ruby-debug by Kent Sibilev since the breakpointer has been broken since Ruby 1.8.4 and will not be coming back [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6611 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-28 15:57:29 +00:00
Michael Koziarski
9d08a07c48
Improve Performance of calling create on has_many :through associations by avoiding loading the target collection. Closes #8150 [evan]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6581 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-26 00:18:38 +00:00
David Heinemeier Hansson
57352f86d4
Improved performance by relying less on exception raising #8159 [Blaine]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-24 16:58:24 +00:00
David Heinemeier Hansson
52a9e5089c
Added ActiveRecord::Base.inspect to return a column-view like #<Post id:integer, title:string, body:text> [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6549 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-21 17:35:09 +00:00
David Heinemeier Hansson
635c7f43dd
Run with the latest versions so beta gems will work
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6548 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-21 17:06:16 +00:00
David Heinemeier Hansson
c2f4681ab4
Added yielding of Builder instance for ActiveRecord::Base#to_xml calls [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6519 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-04-13 01:26:17 +00:00
Rick Olson
2a305949d7
documentation project patches, closes #7342 , #7319 , #7316 , #7190 [jeremymcanally]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6470 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-27 14:04:06 +00:00
Rick Olson
4b78a2a245
Add helpful debugging info to the ActiveRecord::StatementInvalid exception in ActiveRecord::ConnectionAdapters::SqliteAdapter#table_structure. Closes #7925 . [court3nay]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6469 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-27 06:57:53 +00:00
Jeremy Kemper
b5e01f3e4a
SQLite: binary escaping works with ='u'. Closes #7862 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6449 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-19 12:49:23 +00:00
Jeremy Kemper
27ba5edef1
Hash#to_xml supports YAML attributes; ActiveRecord::Base#to_xml support serialized attributes. Closes #7502 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6444 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-18 07:30:09 +00:00
Jeremy Kemper
3d5c947155
Fix method visibility bug uncovered by #7854 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6442 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-18 03:32:48 +00:00
Jeremy Kemper
a38f28fff1
Base.update_all :order and :limit options. Useful for MySQL updates that must be ordered to avoid violating unique constraints.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6440 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-17 15:48:47 +00:00
Michael Koziarski
f87db851c6
Remove deprecated object transactions. People relying on this functionality should install the object_transactions plugin at http://code.bitsweat.net/svn/object_transactions . Closes #5637 [Koz, Jeremy Kemper]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6439 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-16 22:39:01 +00:00
Jeremy Kemper
db69c9c12a
PostgreSQL: remove DateTime -> Time downcast. Bypass the DateTime migration test on 64-bit platforms since it may be a Time.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6433 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-16 08:25:37 +00:00
Jeremy Kemper
14cc8d2faf
find_or_create_by_* takes a hash so you can create with more attributes than are in the method name. Closes #7368 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6420 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-14 01:08:45 +00:00
Michael Koziarski
5bd116ccf4
Make sure with_scope takes both :select and :joins into account when setting :readonly. Allows you to save records you retrieve using finders on a has_many :through associations. [Koz]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6413 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-13 09:45:09 +00:00
Rick Olson
42f8e3f611
trim the fat
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6411 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-13 05:38:01 +00:00
Rick Olson
e3dab67c44
Allow a polymorphic :source for has_many :through associations. Closes #7143 [protocool]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6408 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-13 05:23:18 +00:00
Jeremy Kemper
07d8f46b85
Consistent public/protected/private visibility for chained methods. Closes #7813 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6396 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-13 02:14:31 +00:00
Jeremy Kemper
bedb879913
Oracle: fix quoted primary keys and datetime overflow. Closes #7798 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6388 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-12 05:44:01 +00:00
Jeremy Kemper
be408bd4c6
Fix @logger.debug? conditional considering @logger may be nil.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6375 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-11 12:30:28 +00:00
Jeremy Kemper
98165fd31e
Consistently quote primary key column names. Closes #7763 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6364 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-09 03:23:37 +00:00
Jeremy Kemper
49d1f6a813
Fixtures: fix YAML ordered map support. Closes #2665 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6360 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-09 02:06:50 +00:00
Jeremy Kemper
866cba7bb7
DateTimes assume the default timezone. Closes #7764 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6359 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-09 00:34:17 +00:00
Jeremy Kemper
c59bce8596
Fix typo. References #7727 , closes #7762 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6355 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-08 12:11:51 +00:00
Jeremy Kemper
e0cded2bbf
Sybase: hide timestamp columns since they're inherently read-only. Closes #7716 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6349 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-06 09:43:28 +00:00
Jeremy Kemper
7b9824f6e2
Oracle: overflow Time to DateTime. Closes #7718 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6348 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-06 09:39:50 +00:00
Jeremy Kemper
1e9e198cc5
Note that find results may not be in the same order as the id arguments. Closes #7719 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6347 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-06 09:33:08 +00:00
Jeremy Kemper
821f2d58a7
PostgreSQL: don't use async_exec and async_query with postgres-pr. Closes #7727 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6346 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-06 09:27:54 +00:00
Jeremy Kemper
d1b08f4a75
Fix an edge case with dates during the Italian calendar reform! Hehe. Closes #7724 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6341 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-06 00:49:11 +00:00
Jeremy Kemper
0e8c3b8dd9
Fix has_many :through << with custom foreign keys. Closes #6466 , #7153 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6336 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-05 11:34:39 +00:00
Marcel Molina
bda4009aee
Fix typo in validations documentation. Closes #7669 . [ee]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-03 18:49:43 +00:00
Jeremy Kemper
b2c0359b3e
SQLServer: recognize real column type as Ruby float, correctly schema-dump tables with no indexes or descending indexes. References #7057 , #7703 . Closes #7333 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6297 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-03-03 14:20:57 +00:00
Jeremy Kemper
9ea68721ac
mysql.rb ignores IOError in finalizer when socket is already closed
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6241 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-26 21:40:50 +00:00
David Heinemeier Hansson
23e24c5996
Setting fixtures automatically for integration tests is a bit harder -- will have to wait until the test superclass reform is implemented
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6228 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-25 19:27:56 +00:00
David Heinemeier Hansson
87b7b5b3e7
Added fixtures :all to test_helper.rb to assume that most people just want all their fixtures loaded all the time [DHH] Added fixtures :all as a way of loading all fixtures in the fixture directory at once ( closes #7214 ) [manfred]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6227 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-25 17:31:43 +00:00
Jeremy Kemper
f2fb711152
Ruby 1.8.6 compatibility.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6204 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 11:00:06 +00:00
Jeremy Kemper
f425bba9cf
Use the query cache iff Active Record is configured.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6202 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 08:14:47 +00:00
David Heinemeier Hansson
25bb98e42d
Added database connection as a yield parameter to ActiveRecord::Base.transaction so you can manually rollback [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6196 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 22:13:39 +00:00
Tobias Lütke
7842caed94
Fixed query cache when multiple database connections were involved
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6195 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 21:54:41 +00:00
Tobias Lütke
2ffbc6115e
Enable active record cache automatically for all actions
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6189 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 18:08:39 +00:00
Tobias Lütke
b5419cd66e
You can now use cache in instance hierachies. This allows ActiveRecord::Base.cache { } usage to cache everything
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6179 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-20 23:42:04 +00:00
Jamis Buck
83752373b9
Made increment_counter/decrement_counter play nicely with optimistic locking, and added a more general update_counters method
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6139 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-07 16:10:40 +00:00
Tobias Lütke
f458b376c5
Introducing Model.cache { ... } for the occasional query caching needs. ( fantastic to reduce the 200 SELECT * from accounts WHERE id=1 queries in your views )
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6138 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-06 21:16:07 +00:00
David Heinemeier Hansson
8f614a80e7
Fix gem deprecation warnings, which also means depending on RubyGems 0.9.0+ [Chad Fowler]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6119 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-04 20:44:45 +00:00
Jamis Buck
3f4cbccb9c
When dealing with SQLite3, use the table_info pragma helper, so that the bindings can do some translation for when sqlite3 breaks incompatibly between point releases. Also, make current_adapter? use is_a? instead of instance_of? to account correctly for adapter subclassing.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6091 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-30 03:14:55 +00:00
Jeremy Kemper
d5e122002a
Oracle: fix lob and text default handling. Closes #7344 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6090 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-29 22:06:08 +00:00
Jeremy Kemper
16f6bd4070
SQLServer: don't choke on strings containing 'null'. Closes #7083 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-28 17:51:21 +00:00
Jeremy Kemper
269ad9711d
MySQL: blob and text columns may not have defaults in 5.x. Update fixtures schema for strict mode. Closes #6695 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6074 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-28 15:45:06 +00:00
Jeremy Kemper
5acea7fc9c
update_all can take a Hash argument. sanitize_sql splits into two methods for conditions and assignment since NULL values and delimiters are handled differently. References #6583 , closes #7365 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6073 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-28 15:12:54 +00:00
Jeremy Kemper
8f5c12e451
MySQL: SET SQL_AUTO_IS_NULL=0 so 'where id is null' doesn't select the last inserted id. Closes #6778 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6064 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-28 08:49:23 +00:00
Jeremy Kemper
c6b15dde1b
Use Date#to_s(:db) for quoted dates. Closes #7411 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6061 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-28 07:58:02 +00:00
Rick Olson
1a11bffde1
Don't create instance writer methods for class attributes. Closes #7401 [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6051 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-28 01:31:31 +00:00
David Heinemeier Hansson
0aa0c84c17
Nodoc the irrelevant (from 1.2)
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6044 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-26 21:37:38 +00:00
Jeremy Kemper
873f5e2f3c
Docs: validations examples. Closes #7343 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6031 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-24 12:17:14 +00:00
Jeremy Kemper
0eb8398cfa
Fixtures use the table name and connection from set_fixture_class. Closes #7330 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6023 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-24 01:29:49 +00:00
Rick Olson
8296c680d5
Remove useless code in #attribute_present? since 0 != blank?. Closes #7249 [Josh Susser]. Fix minor doc typos. Closes #7157 [Josh Susser]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-23 05:10:21 +00:00
Rick Olson
bc97a87138
Fix incorrect usage of #classify when creating the eager loading join statement. Closes #7044 [Josh Susser]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6017 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-23 05:07:35 +00:00
Jeremy Kemper
fee8856ff1
SQLServer: quote table name in indexes query. Closes #2928 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6014 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-23 04:23:29 +00:00
Jeremy Kemper
06afb8c746
Subclasses of an abstract class work with single-table inheritance. References #5704 , closes #7284 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6013 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-23 04:19:16 +00:00
Jamis Buck
7359dc0028
Make sure sqlite3 driver closes open connections on disconnect ( closes #7105 )
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6012 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-22 23:07:54 +00:00
Rick Olson
56c5535466
[DOC] clear up some ambiguity with the way has_and_belongs_to_many creates the default join table name. #7072 [jeremymcanally]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5960 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-16 06:30:02 +00:00
Michael Koziarski
71a4f7161f
Allow the Oracle adapter to insert a string "null". Closes #6997 [laurelfan]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5958 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-16 01:39:05 +00:00
Michael Koziarski
8437be3380
Improve handling of LoadErrors with the oracle adapter. Closes #6780 [kubo]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5956 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-16 01:31:25 +00:00
David Heinemeier Hansson
6d37c638e7
Made sure that connections are only removed for SQLite
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5955 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-15 22:12:40 +00:00
Jamis Buck
521ca37c3e
be like a duck. Let's not rely on explicit classes, so we can pass proxy objects around and have them interpreted correctly by ActiveRecord's serialization routines
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5953 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-15 17:23:01 +00:00
Jeremy Kemper
d1917cfea2
Skip column options for primary keys. Closes #7048 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5944 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-15 15:48:38 +00:00
Michael Koziarski
51d840e272
Improve association documentation, closes #7022 . [hasmanyjosh]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5939 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-15 06:43:47 +00:00
Jeremy Kemper
6019c26856
change_column accepts :default => nil. Closes #6956 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5937 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-15 02:22:53 +00:00
Jeremy Kemper
a491f92860
MySQL, PostgreSQL: change_column_default quotes the default value and doesn't lose column type information. References #3987 , closes #6664 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5935 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-15 01:24:23 +00:00
Jeremy Kemper
e310344111
Oracle: create_table takes a :sequence_name option to override the 'tablename_seq' default. Closes #7000 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5933 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-15 00:34:43 +00:00
Jeremy Kemper
0227f86eee
MySQL: retain SSL settings on reconnect. Closes #6976 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5929 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-14 15:19:18 +00:00
Jeremy Kemper
b78458284b
Aggregate reflection klass works with nested :class_name
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5923 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-14 12:08:44 +00:00
Jeremy Kemper
937eeab103
Oracle: correctly perform eager finds with :limit and :order. Closes #7021 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5919 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-13 07:43:35 +00:00
Tobias Lütke
e24d2f7234
Apply scoping during initialize instead of create. Fixes setting of foreign key when using find_or_initialize_by with scoping.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5913 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-12 21:14:36 +00:00
Jeremy Kemper
c302cdfcc4
Fix scope typo in add_lock! Closes #6482 . [zubek]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5907 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-12 10:18:11 +00:00
Jeremy Kemper
9073cef866
SQLServer: handle [quoted] table names. Closes #6635 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5891 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-12 05:44:28 +00:00
Jeremy Kemper
8d3ff3abc7
acts_as_nested_set works with single-table inheritance. Closes #6030 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5889 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-12 05:33:09 +00:00
Jeremy Kemper
ef4ac31de3
PostgreSQL: use a subselect to correctly perform eager finds with :limit and :order. Closes #4668 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5887 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-12 05:14:55 +00:00
Jeremy Kemper
3b6555acd4
Fix new_record? and id rollback. Closes #6910 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5886 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-12 05:10:06 +00:00
Jamis Buck
8dd08f98c7
dry up some duplicated code
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5883 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-11 18:19:23 +00:00
Jamis Buck
0d34c28199
treat create! like create and make sure the target is loaded first
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5882 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-11 18:10:42 +00:00
Jamis Buck
c398e83893
fix regression in has_one#create, that caused instances thus created to be orphaned
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5881 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-11 18:04:47 +00:00
Jeremy Kemper
28767075f4
Pass a range in :conditions to use the SQL BETWEEN operator. Closes #6974 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5876 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-10 10:13:18 +00:00
Michael Koziarski
b4282df966
Fix the Oracle adapter for serialized attributes stored in CLOBs. Closes #6825 [mschoen, tdfowler]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5866 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-05 23:42:03 +00:00
Rick Olson
1400e7f864
[DOCS] Apply more documentation for ActiveRecord Reflection. Closes #4055 [Robby Russell]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5855 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-05 20:22:41 +00:00
Rick Olson
606376bd44
[DOCS] Document :allow_nil option of #validate_uniqueness_of. Closes #3143 [Caio Chassot]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5853 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-05 20:17:37 +00:00
Michael Koziarski
84481dd3b4
Sybase adapter fixes. Closes #6926 [jsheets]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5839 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-05 00:12:06 +00:00
Rick Olson
1af2022cc3
Rollback #new_record? and #id values for created records that rollback in an after_save callback. Closes #6910 [Ben Curren]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5830 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-01-02 05:36:30 +00:00
Jamis Buck
6a5388b654
try to appease the angry Oracle
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5808 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-29 19:05:53 +00:00
Jamis Buck
0bfabaa048
make sure query attributes on custom fields works as it used to
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5807 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-29 17:24:35 +00:00
Michael Koziarski
3b4450bb80
Docs fix for columns_hash [bradediger]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5797 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-27 20:41:55 +00:00
Michael Koziarski
58edaaad0b
Ensure dynamic finders are anchored to the beginning of the method name to prevent
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5795 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-27 20:35:19 +00:00
Jeremy Kemper
4cf8bf7312
Pushing a record on an association collection doesn't unnecessarily load all the associated records.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5769 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-21 23:28:12 +00:00
Jeremy Kemper
a8b53f1dbb
Oracle: fix connection reset failure. Closes #6846 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5761 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-20 21:14:41 +00:00
Jeremy Kemper
7277c51891
Partially revert [5660] - makes more trouble than it resolves. References #5704 , closes #6766 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5753 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-19 19:47:21 +00:00
Jeremy Kemper
8732ce291b
Subclass instantiation doesn't try to explicitly require the corresponding subclass. Closes #6840 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5751 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-19 19:23:56 +00:00
Rick Olson
41466a4c83
fix faulty inheritance tests and that eager loading grabs the wrong inheritance column when the class of your association is an STI subclass. Closes #6859 [protocool]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5744 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-19 03:10:39 +00:00
Tobias Lütke
906bd93f4f
Remove side effects of [5684]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5705 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-08 21:41:15 +00:00
Tobias Lütke
cdad2d41e1
Consolidated different create and create! versions to call through to the base class with scope. This fixes inconsistencies, especially related to protected attribtues.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5684 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-06 00:13:31 +00:00
Jeremy Kemper
8dea60b0c3
find supports :lock with :include. Check whether your database allows SELECT ... FOR UPDATE with outer joins before using. Closes #6764 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5682 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-05 22:07:55 +00:00
Jeremy Kemper
eb300f8428
AssociationCollection#any? takes a block [Michael Schoen]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-05 21:49:36 +00:00
Tobias Lütke
0ee0c1b2aa
Add AssociationCollection#create! to be consistent with AssociationCollection#create when dealing with a foreign key that is a protected attribute
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5677 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-05 17:55:44 +00:00
David Heinemeier Hansson
22f095be23
Added counter optimization for AssociationCollection#any? so person.friends.any? won't actually load the full association if we have the count in a cheaper form [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5676 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-05 03:26:56 +00:00
Jeremy Kemper
8ffb22056c
Subclasses of an abstract class work with single-table inheritance. Closes #5704 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-01 21:24:47 +00:00
David Heinemeier Hansson
2e2bf2d149
If only life was that simple (it didnt help)
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5658 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-01 05:56:51 +00:00
David Heinemeier Hansson
e8eb743ba6
Replace the elaborate reloading connection checking scheme, just fix the Ruby-based MySQL adapter, ye?
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5656 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-12-01 05:37:56 +00:00
David Heinemeier Hansson
0a86122a24
Only reload connections in development mode that supports (and requires that) -- in other words, only do it for SQLite ( closes #6687 , #6700 ) [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5637 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-26 22:10:55 +00:00
Michael Koziarski
a2e826dc0f
Change fixture_path to a class inheritable accessor allowing test cases to have their own custom set of fixtures. Closes #6672 [zdennis]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5604 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-21 22:28:24 +00:00
Jeremy Kemper
9104d63f99
Quote ActiveSupport::Multibyte::Chars. Closes #6653 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5597 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 12:02:04 +00:00
Jeremy Kemper
cd6beacfb3
Test for forged '' default before it's typecast. Closes #6156 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 11:44:31 +00:00
Jeremy Kemper
427fb035a3
Simplify query_attribute by typecasting the attribute value and checking whether it's nil, false, zero or blank. Closes #6659 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5593 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 11:22:38 +00:00
Jeremy Kemper
9594832a8d
validates_numericality_of uses \A \Z to ensure the entire string matches rather than ^ $ which may match one valid line of a multiline string. Closes #5716 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5589 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 10:51:50 +00:00
Jeremy Kemper
88bd86e8bc
Run validations in the order they were declared. Closes #6657 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5588 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 10:12:38 +00:00
Jeremy Kemper
19c99acfbc
MySQL: detect when a NOT NULL column without a default value is misreported as default ''. Can't detect for string, text, and binary columns since '' is a legitimate default. Closes #6156 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5586 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-20 08:54:42 +00:00
Jeremy Kemper
02adc49d72
Simplify association proxy implementation by factoring construct_scope out of method_missing. Closes #6643 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5564 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-19 11:16:12 +00:00
Jeremy Kemper
ae8171ddc5
Migration benchmark wrappers use alias_method_chain. Closes #6456 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-19 11:09:31 +00:00
Jeremy Kemper
be3a4c3daa
Mysql::Result#all_hashes compatibility with Mysql C driver 2.6.x. Closes #6601 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5533 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-16 01:41:22 +00:00
Jeremy Kemper
50ee332c4a
Cleanup SQLite AUTOINCREMENT: exclude sqlite_sequence table, factor out feature availability check.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5520 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-14 03:32:16 +00:00
Jeremy Kemper
4978d1dce7
Oracle: automatically detect the primary key. Closes #6594 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5514 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-13 19:23:32 +00:00
Jeremy Kemper
a303a168ac
Oracle: to increase performance, prefetch 100 rows and enable similar cursor sharing. Both are configurable in database.yml. Closes #6607 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5509 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-13 07:36:52 +00:00
Jeremy Kemper
c0bce43e90
Oracle: fix limited id selection for eager loading. Closes #6515 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5480 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-10 19:18:07 +00:00
Jeremy Kemper
63df6eb382
Don't inspect unloaded associations. Closes #2905 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5478 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-10 02:00:14 +00:00
Jeremy Kemper
d97a84fb59
SQLite: use AUTOINCREMENT primary key in >= 3.1.0. Closes #6588 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-09 21:17:43 +00:00
Jeremy Kemper
9d2da04680
Cache inheritance_column. Closes #6592 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-09 19:31:31 +00:00
Jeremy Kemper
66b92abfc3
Firebird: decimal/numeric support. Closes #6408 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5459 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-07 19:56:01 +00:00
Jamis Buck
57a3e44052
make add_order a tad faster ( Closes #6567 )
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5452 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-07 19:06:35 +00:00
Jeremy Kemper
a3dba1ed7c
Find with :include respects scoped :order. Closes #5850 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-07 00:18:07 +00:00
Jeremy Kemper
2fbe0ae7a2
Support nil and Array in :conditions => { attr => value } hashes. Closes #6548 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5435 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-05 21:27:51 +00:00
Jeremy Kemper
5b979ed8ff
Consistently use LOWER() for uniqueness validations (rather than mixing with UPPER()) so the database can always use a functional index on the lowercased column. Closes #6495 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-05 19:20:39 +00:00
Jeremy Kemper
b6171e7105
SQLite: count(distinct) queries supported in >= 3.2.6, fix calculations workaround, remove count(distinct) query rewrite, cleanup test connection scripts. Closes #6544 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5426 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-05 02:01:31 +00:00
Jeremy Kemper
c7c3994d31
Dynamically generate reader methods for serialized attributes. Closes #6362 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5416 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-02 20:20:46 +00:00
Jeremy Kemper
88d9b32496
Deprecation: object transactions warning.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5405 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-02 18:12:18 +00:00
Jeremy Kemper
ac715b2bcb
has_one :dependent => :nullify ignores nil associates. Closes #6528 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5401 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-02 09:45:17 +00:00
Jeremy Kemper
70840d4b7f
Oracle: resolve test failures, use prefetched primary key for inserts, check for null defaults. Factor out some common methods from all adapters. Closes #6515 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5384 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-11-01 20:28:48 +00:00
Jamis Buck
e411b545a5
a few more deprecation improvements
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5360 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-24 17:27:16 +00:00
Jamis Buck
e5684a2877
update deprecations to include alternative methods (where available)
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5359 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-24 17:25:30 +00:00
Michael Koziarski
53a97e9d61
Make add_column use the options hash with the Sqlite Adapter. Closes #6464 [obrie]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5353 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-24 07:32:18 +00:00
Marcel Molina
fb7807e244
Document other options available to migration's add_column. #6419
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5333 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-22 02:55:21 +00:00
Jeremy Kemper
8949ce0982
MySQL: all_hashes compatibility with old MysqlRes class. Closes #6429 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5330 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-20 20:30:59 +00:00
Rick Olson
c5536f9f00
Fix has_many :through to add the appropriate conditions when going through an association using STI. Closes #5783 . [Jonathan Viney] (sorry, forgot to commit the actual files)
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5310 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-16 15:42:55 +00:00
Rick Olson
2c6b6e2866
automatically add primary key to #select_limited_ids_list order by clause for databases that require order columns in the distinct statements (postgresql) [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5292 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-13 08:52:33 +00:00
Rick Olson
e789b26e65
fix select_limited_ids_list issues in postgresql, retain current behavior in other adapters [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5291 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-13 08:29:00 +00:00
Rick Olson
7870494673
Restore eager condition interpolation, document it's differences [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5284 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-11 14:02:24 +00:00
Jeremy Kemper
1117387376
Compare to 0 rather than call zero? to handle nil.
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5282 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-11 00:29:59 +00:00
Jeremy Kemper
629b8af2b0
Wrap save! in a transaction. Closes #6324 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5281 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-10 19:34:25 +00:00
Jeremy Kemper
f65ab3b233
improve example in migrations docs, closes #6370
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5275 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 22:05:50 +00:00
Jeremy Kemper
2c3ca4c4e6
Don't rollback in teardown unless a transaction was started. Don't start a transaction in create_fixtures if a transaction is started. Closes #6282 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5270 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 07:48:27 +00:00
Rick Olson
850087f0bd
Add #delete support to has_many :through associations. Closes #6049 [Martin Landers]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5267 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 03:21:52 +00:00
Rick Olson
4e66f5bfe7
learn to clean up after myself
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5266 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 03:13:06 +00:00
Rick Olson
c98b471ca4
Reverted old select_limited_ids_list postgresql fix that caused issues in mysql. Closes #5851 [Rick]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5265 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 03:12:32 +00:00
Rick Olson
8e3bf70bcd
Removes the ability for eager loaded conditions to be interpolated, since there is no model instance to use as a context for interpolation. #5553 [turnip@turnipspatch.com]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5264 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 02:46:57 +00:00
David Heinemeier Hansson
fe4d5ea786
Fixed rename_table on SQLite tables with indexes defined ( closes #5942 ) [brandon@opensoul.org]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5260 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 02:14:36 +00:00
David Heinemeier Hansson
fc7fd4c5ce
Docfix ( closes #6040 )
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5259 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 02:05:50 +00:00
David Heinemeier Hansson
943be923f0
Added timeout option to SQLite3 configurations to deal more gracefully with SQLite3::BusyException, now the connection can instead retry for x seconds to see if the db clears up before throwing that exception ( closes #6126 ) [wreese@gmail.com] Added default timeout setting of 5 seconds to SQLite3 database.yml configurations [DHH]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5258 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 02:02:27 +00:00
David Heinemeier Hansson
55aab5b8ac
Added update_attributes! which uses save! to raise an exception if a validation error prevents saving ( closes #6192 ) [jonathan]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5256 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 01:52:24 +00:00
David Heinemeier Hansson
9fd88d7939
Deprecated add_on_boundary_breaking (use validates_length_of instead) ( closes #6292 ) [BobSilva]
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5255 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-10-09 01:42:09 +00:00