Commit Graph

2369 Commits

Author SHA1 Message Date
Matt Conway
1c9b3aabdd Allow connect_timeout, read_timeout and write_timeout settings for MySQL [#2544 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 17:13:22 +01:00
railsbob
076ca48bd6 Ensure hm:t#find does not assign nil to :include [#1845 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 17:02:19 +01:00
Mike Breen
7d254b5d74 Serialized attributes should only be saved with partial_updates when the serialized attribute is present [#2397 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 16:34:53 +01:00
Dmitry Ratnikov
314ba0433f Changed to use klass instead of constantizing in assign_ids generated method
[#260 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 02:52:06 -07:00
Rich Bradley
9bb8ef9ede Fix for nested :include with namespaced models.
[#260 state:committed]
2009-08-09 00:31:46 -07:00
Tristan Dunn
791cccaeda Don't define a default primary key in the schema dumper.
[#1908 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-08 19:31:35 -07:00
Matt Duncan
3b3798506b Adding :from scoping to ActiveRecord calculations
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1229 state:committed]
2009-08-09 12:43:07 +12:00
Pratik Naik
761283ffdb Ensure hm:t#create/create! throws ActiveRecord::RecordNotSaved when the owner is new 2009-08-08 21:51:33 +01:00
Pratik Naik
6464d76feb DRY migration's rollback/forward methods 2009-08-08 20:47:14 +01:00
Cristi Balan
7f84f14efa Add rake db:forward - opposite of db:rollback [#768 state:resolved]
Example:
  rake db:forward # performs the next migration
  rake db:forward STEP=4 # performs the next 4 migrations

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 17:41:43 +01:00
Jeremy Kemper
482a6f716f Ruby 1.9.2: Object#id is gone now 2009-08-07 16:41:04 -07:00
José Valim
7034272354 Add destroyed? to ActiveRecord, include tests for polymorphic urls for destroyed objects and refactor mime responds tests and documentation. 2009-08-07 17:16:16 +02:00
Akira Matsuda
230d43fbf5 Ruby 1.9.2 compat: Array#* uses to_str instead of to_s to join values since Ruby 1.9.2
[#2959 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-05 17:08:02 -07:00
Geoff Buesing
bfafe8c405 Revert "fallback_string_to_date sets Date._parse comp arg to true, so that strings with two-digit years, e.g. '1/1/09', are interpreted as modern years" [#2019 state:wontfix]
This reverts commit 55d1d12c32.
2009-08-05 08:26:12 -05:00
Joshua Peek
f8d3c72c39 Extract generic attribute method generation to AMo 2009-08-04 23:36:05 -05:00
Joshua Peek
64eecdd131 whitespace 2009-08-04 16:28:44 -05:00
Paul Gillard
bada18dc36 Added reset_attribute! method to ActiveRecord::AttributeMethods::Dirty which will reset an attribute to its original value should it have changed.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-04 16:23:08 -05:00
Paul Gillard
c30a0ce3c8 Modified ActiveRecord::AttributeMethods to allow classes to specify attribute method prefixes and/or suffixes. Previously only suffixes were allowed.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-04 16:19:19 -05:00
Joshua Peek
aad5a30bf2 Add simple support for ActiveModel's StateMachine for ActiveRecord 2009-08-04 11:03:57 -05:00
Matt Ganderup
55d1d12c32 fallback_string_to_date sets Date._parse comp arg to true, so that strings with two-digit years, e.g. '1/1/09', are interpreted as modern years [#2019 state:resolved] 2009-08-03 22:41:56 -05:00
Geoff Buesing
6f97ad07de quoted_date converts time-like objects to ActiveRecord::Base.default_timezone before serialization. This allows you to use Time.now in find conditions and have it correctly be serialized as the current time in UTC when default_timezone == :utc [#2946 state:resolved] 2009-08-03 22:03:47 -05:00
Joshua Peek
9b68877897 Track generated attribute methods in a separate module 2009-08-02 21:06:35 -05:00
Jeremy Kemper
cdf60e46cc SQLite: drop support for 'dbfile' option in favor of 'database.' 2009-08-01 18:22:12 -07:00
Joshua Peek
62fd1d3716 Start separating primary key concerns 2009-07-30 17:54:02 -05:00
Joshua Peek
ded3d97c5a Make sure we use send for the default attribute method body because the suffix maybe an invalid method name 2009-07-30 17:54:02 -05:00
Joshua Peek
1ae7eb5200 Make sure to reset defined methods after calling attribute_method_suffix 2009-07-30 17:54:02 -05:00
Joshua Peek
d599ea27c5 Move attribute_types_cached_by_default into attribute methods reading concern 2009-07-30 17:54:02 -05:00
Joshua Peek
89e9efcbe2 Don't need to pass attr_name to evaluate_attribute_method anymore 2009-07-30 17:54:01 -05:00
Joshua Peek
2c30c9fe6c Undefine id and let it automatically be generated 2009-07-30 17:54:01 -05:00
Joshua Peek
f8d2c77c90 Redirect method missing for primary key to read_attribute 2009-07-30 17:54:01 -05:00
Joshua Peek
9cdcfb4fc5 ditto for id= 2009-07-30 17:54:01 -05:00
Joshua Peek
831c38ffc7 Don't define id_before_type_cast, just let it be generated on its own 2009-07-30 17:54:01 -05:00
Joshua Peek
1841fd54e6 Move id attribute methods into their related concern 2009-07-30 17:54:01 -05:00
Joshua Peek
3e58f8e191 Restore DangerousAttributeError 2009-07-30 17:54:00 -05:00
Joshua Peek
e129c5673a Wrap up attribute method reset concerns in 'undefine_attribute_methods' 2009-07-30 17:54:00 -05:00
Joshua Peek
586baf8ffe read_attribute is always available through attribute 2009-07-30 17:54:00 -05:00
Joshua Peek
bd07c5ca8e cache_attributes is related to attribute reading 2009-07-30 17:54:00 -05:00
Joshua Peek
94dabf9b4b Generate methods for all suffixes 2009-07-30 17:54:00 -05:00
Joshua Peek
c2b075bed0 Concernify AR AttributeMethods 2009-07-30 17:53:59 -05:00
Jeremy Kemper
d83b182857 Revert "Methods invoked within named scope Procs should respect the scope stack. [#1267 state:resolved]"
This reverts commit 6a13376525.

Conflicts:

	activerecord/test/cases/named_scope_test.rb
2009-07-29 16:54:54 -07:00
Pratik Naik
e033b5d037 Merge docrails 2009-07-25 16:03:58 +01:00
John Maxwell
c39151a847 Patch to ActiveModel's (and ActiveRecord, by association) XML serialization: If two parameters are present in Procs supplied to to_xml's :procs option, the model being serialized will be passed as the second argument [#2373 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-07-22 20:47:15 -05:00
Joshua Peek
92c00d7586 AMo conversion helper 2009-07-21 00:51:57 -05:00
Joshua Peek
7c84bbf160 Add wrap_with_notifications helper to AMo observing 2009-07-20 23:57:01 -05:00
Yehuda Katz
37658f15bb Merge branch 'master' of git@github.com:rails/rails 2009-07-19 13:21:17 -07:00
Yehuda Katz
5ffaaa71d1 Define ActiveModel API Compliance
- Define to_model on AR
  - Define to_model on ActiveModel::APICompliant
  - Update test fixtures to be API Compliant
  - Start using to_model in AP
2009-07-20 00:27:04 +09:00
Szymon Nowak
1c11437a32 Add primary_key option to belongs_to association
[#765 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-07-15 18:13:32 -07:00
Pratik Naik
40b387580f Use map! instead of map for <association>_ids 2009-07-13 21:59:06 +01:00
Pratik Naik
373b053dc8 Optimize <association>_ids for hm:t with belongs_to source 2009-07-13 16:29:19 +01:00
Joshua Peek
e83a05af07 Integrate AMo XML serializer into AR 2009-07-11 16:20:58 -05:00