Commit Graph

7816 Commits

Author SHA1 Message Date
Francesco Rodriguez
21f4c2eb59 adding :call-seq: to CollectionProxy methods 2012-05-22 11:13:31 -05:00
Francesco Rodriguez
2c62dd64db add CollectionProxy#build documentation 2012-05-22 11:03:07 -05:00
Santiago Pastorino
344ea04865 Fix the build 2012-05-22 12:10:35 -03:00
Francesco Rodriguez
d1cab8e5e0 remove repeated documentation in CollectionProxy#clear 2012-05-22 09:55:31 -05:00
Santiago Pastorino
38293ea828 require active_support/lazy_load_hooks where is needed 2012-05-22 11:33:03 -03:00
Jeremy Kemper
d3ee0a2449 Merge pull request #6368 from Antiarchitect/store-indifferent-access
Support migrating from Hash to HashWithIndifferentAccess for accessing attributes.
2012-05-22 07:31:40 -07:00
Andrey Voronkov
940c135175 Convert Hash to HashWithIndifferentAccess in ActiveRecord::Store.
In order to make migration from 3.x apps easier, we should try to
convert
Hash instances to HashWithIndifferentAccess, to allow accessing values
with both symbol and a string. This is follow up to changes in 3c0bf043.
2012-05-22 18:08:39 +04:00
Francesco Rodriguez
8281194fee update CollectionProxy#clear documentation 2012-05-21 23:51:31 -05:00
Francesco Rodriguez
1bcd5e42ed update CollectionProxy#delete_all documentation 2012-05-21 23:49:41 -05:00
Francesco Rodriguez
f9a718eb5e add CollectionProxy#delete_all documentation 2012-05-21 23:30:13 -05:00
Godfrey Chan
cb847b9f2e Restore the frozen state on rollback. Fixes #6417.
Currently, when saving a frozen record, an exception would be thrown
which causes a rollback. However, there is a bug in active record that
"defrost" the record as a side effect:

    >> t = Topic.new
    => #<Topic id: nil, ...>
    >> t.freeze
    => #<Topic id: nil, ...>
    >> t.save
    RuntimeError: can't modify a frozen Hash
    >> t.frozen?
    => false
    >> t.save
    => true

This patch fixes the bug by explictly restoring the frozen state on the
attributes Hash after every rollback.
2012-05-21 14:57:04 -07:00
Alexey Vakhov
5b7b705d36 Fix AR preloader example 2012-05-22 01:37:03 +04:00
Carlos Antonio da Silva
03886d8173 Remove not used variables from connection poll test
These variables were issuing some "not used" warnings.
2012-05-21 18:35:45 -03:00
Carlos Antonio da Silva
d5d9a281aa Refactor aggregation writer method
Only constantize class_name once.
2012-05-21 18:34:58 -03:00
Aaron Patterson
d2901f0fc4 Merge pull request #6416 from pmahoney/threadsafe-connection-pool
Make connection pool fair with respect to waiting threads.
2012-05-21 10:29:01 -07:00
Francesco Rodriguez
ab2e2a9d2b fix CollectionProxy documentation markup 2012-05-21 12:26:04 -05:00
Francesco Rodriguez
158a71b2cb add CollectionProxy#reload documentation 2012-05-21 12:19:34 -05:00
Francesco Rodriguez
1f5c1a1423 improve CollectionProxy#destroy documentation 2012-05-21 11:56:00 -05:00
Aaron Patterson
525839fdd8 Merge pull request #6143 from senny/composed_of_converter_returns_nil
allow the :converter Proc form composed_of to return nil
2012-05-21 09:46:24 -07:00
Francesco Rodriguez
d83173483d add CollectionProxy#destroy documentation 2012-05-21 10:16:43 -05:00
Patrick Mahoney
d06674d5df Make connection pool fair with respect to waiting threads. 2012-05-20 21:48:04 -05:00
Francesco Rodriguez
03402d206a update CollectionProxy#destroy_all documentation 2012-05-20 16:14:47 -05:00
Ivan Kukobko
45d059b401 fixed typo in word finiding 2012-05-20 22:11:32 +03:00
Henrik Hodne
fa6d921e11 Remove blank trailing comments
For future reference, this is the regex I used: ^\s*#\s*\n(?!\s*#). Replace
with the first match, and voilà! Note that the regex matches a little bit too
much, so you probably want to `git add -i .` and go through every single diff
to check if it actually should be changed.
2012-05-20 01:29:13 +02:00
Francesco Rodriguez
a6940f2a83 add CollectionProxy#select documentation 2012-05-19 16:18:59 -05:00
Francesco Rodriguez
952737af35 add CollectionProxy#find documentation 2012-05-19 14:58:19 -05:00
Aaron Patterson
fa41c92930 Merge pull request #6397 from kennyj/fix_translate_exception
Fix a problem of translate_exception method in a Japanese (non English) environment.
2012-05-19 11:46:13 -07:00
Oscar Del Ben
ba896d37e3 Revert typo 2012-05-19 10:53:52 -07:00
Oscar Del Ben
fae4a263c9 Typo 2012-05-19 10:34:42 -07:00
Patrick Mahoney
c2d416fe77 Synchronize read and modification of @reserved_connections hash to avoid concurrency error. 2012-05-19 11:46:58 -05:00
kennyj
2fe281323c Fix a problem of translate_exception method in Japanese. 2012-05-20 01:38:14 +09:00
Vijay Dev
1551de3c04 Merge branch 'master' of github.com:lifo/docrails 2012-05-19 19:36:48 +05:30
Vijay Dev
4adfd8e68d copy edits [ci skip] 2012-05-19 19:33:51 +05:30
Francesco Rodriguez
b0f55c6888 add CollectionProxy#last documentation 2012-05-19 08:20:49 -05:00
Carlos Antonio da Silva
8405aad6fb Merge pull request #4835 from pacoguzman/refactor_define_restrict_dependency_method
Refactor define_restrict_dependency_method using reflection
2012-05-19 06:16:10 -07:00
Francesco Rodriguez
75d71017fd add CollectionProxy#first documentation 2012-05-19 08:15:27 -05:00
Vijay Dev
6c7c997102 Revert "You can add a custom primary key to a table"
This reverts commit 23a98ffbd9b39ee70094ded1671cf1879d0d3591.

[ci skip]
2012-05-19 17:38:44 +05:30
Piotr Sarnacki
099bb5d7b0 Ensure that CollectionAssociation#replace returns proper target
The fix commited in e2a070c was returning the `new_target`, as
a try to return whatever user replaced association with. The
problem is, the resulting association target may be ordered
differently. In such case we want to return the target that
will be later used for that association.
2012-05-19 04:06:11 -07:00
Francesco Rodriguez
bc8b7e0365 improve CollectionProxy#concat documentation 2012-05-19 01:01:51 -05:00
Francesco Rodriguez
970a146997 fix CollectionProxy#<< documentation 2012-05-19 00:48:43 -05:00
Francesco Rodriguez
bb887b92f8 add CollectionProxy#<< documentation 2012-05-19 00:37:47 -05:00
Francesco Rodriguez
3f46f73d00 add CollectionProxy#clear documentation 2012-05-19 00:21:50 -05:00
Jeremy Kemper
98657ad10c Merge pull request #6376 from jgaskins/timestamp-microseconds
Increase numeric-timestamp precision to nanoseconds
2012-05-18 17:30:35 -07:00
Francesco Rodriguez
5111ec446b add CollectionProxy#include? documentation 2012-05-18 19:28:09 -05:00
Jamie Gaskins
900dbc54f1 Increase AR#cache_key precision to nanoseconds 2012-05-19 08:20:08 +08:00
Avi Tzurel
23a98ffbd9 You can add a custom primary key to a table 2012-05-19 00:47:53 +03:00
Francesco Rodriguez
1b5c775e7a move docs from CollectionAssociation to CollectionProxy 2012-05-18 15:27:29 -05:00
Jon Leighton
dcc576df8f fix #delete_all with habtm with :delete_sql 2012-05-18 21:11:34 +01:00
Jon Leighton
a1dd00810c no longer need #delete_all_on_destroy 2012-05-18 21:07:21 +01:00
Francesco Rodriguez
db77b16e4f add explanation of raising errors when a limit scope is supplied in Relation#delete_all 2012-05-18 15:06:47 -05:00
Jon Leighton
80f16946bb Perf: Don't load the association for #delete_all.
Bug #6289
2012-05-18 20:57:32 +01:00
kennyj
576d7007dd Fix logs name consistency. 2012-05-19 04:53:12 +09:00
Aaron Patterson
476ef2df74 port some mocha to minitest/mock 2012-05-18 10:23:26 -07:00
José Valim
f491c6ac2a Merge pull request #6382 from oscardelben/refactor_migration_generator
Refactor migration generator
2012-05-18 09:28:36 -07:00
Oscar Del Ben
925f2e9ab7 Refactor migration generator 2012-05-18 09:24:45 -07:00
Jon Leighton
1ae68ea35f fix typo [ci skip] 2012-05-18 16:39:37 +01:00
Jon Leighton
103ce300ec add changelogs about deprecated stuff [ci skip] 2012-05-18 16:30:05 +01:00
Jon Leighton
62c6ac2f8d quarantine more deprecated stuff 2012-05-18 15:04:36 +01:00
Jon Leighton
ee16feae4a quarantine deprecated tests 2012-05-18 14:46:54 +01:00
Peter Suschlik
83153c7a36 Fix typo. 2012-05-18 12:24:19 +02:00
Francesco Rodriguez
48acd29adb remove incorrect example of CollectionAssociation#empty? 2012-05-18 01:15:41 -05:00
Francesco Rodriguez
bf55f28af1 add docs to CollectionAssociation#empty? 2012-05-18 01:11:37 -05:00
Francesco Rodriguez
d029d50d48 add docs to CollectionAssociation#any? 2012-05-18 01:03:40 -05:00
Francesco Rodriguez
10d375efaa add examples to CollectionAssociation#concat 2012-05-18 00:22:32 -05:00
Francesco Rodriguez
3ef1f94483 fix CollectionAssociation docs 2012-05-17 23:39:15 -05:00
Francesco Rodriguez
fcc13f46f5 add example to CollectionAssociation#destroy_all 2012-05-17 23:30:51 -05:00
Francesco Rodriguez
c0c0ef5992 add more explanation to CollectionAssociation docs 2012-05-17 23:25:27 -05:00
Francesco Rodriguez
e66c0fc049 add CollectionAssociation hierarchy 2012-05-17 23:20:21 -05:00
Francesco Rodriguez
3c91c81270 add docs to CollectionAssociation#many? 2012-05-17 22:43:51 -05:00
Francesco Rodriguez
ea1477fb6d fix CollectionAssociation#replace docs 2012-05-17 15:05:50 -05:00
Aaron Patterson
8067857bdf Merge pull request #6238 from pwnall/pgsql_bytea_limit
Postgresql doesn't accept limits on binary (bytea) columns.
2012-05-17 10:56:39 -07:00
Francesco Rodriguez
cd840c3e38 Add docs to CollectionAssociation#replace 2012-05-17 12:40:35 -05:00
Aaron Patterson
6ada771a08 Merge pull request #6250 from iGEL/dont_destroy_readonly_models
Don't allow to destroy readonly models
2012-05-17 09:56:21 -07:00
Johannes Barre
a8b370f5c2 Don't destroy readonly models 2012-05-17 17:52:17 +02:00
kennyj
6a48c7975e Fix warning: ambiguous first argument. 2012-05-18 00:51:38 +09:00
Jon Leighton
77a40722f7 Merge pull request #6058 from RStankov/relation-from-to-accept-other-relation-objects
Relation#from to accept other Relation objects
2012-05-17 05:30:33 -07:00
Vijay Dev
03f8a57487 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	activerecord/lib/active_record/core.rb
2012-05-17 17:49:33 +05:30
Vijay Dev
b71a90060f Revert "Update docs in sqlite3 adapter"
This reverts commit 8d7c38b858b0190ac56998f4a4baba250eaf1e4e.

Reason: Lot of the additions aren't adding value.

[ci skip]
2012-05-17 17:46:07 +05:30
Aaron Patterson
08212956a7 Merge pull request #5453 from JonRowe/patch_uniq_has_and_belongs_to_many_when_already_loaded
When Active Record has already loaded a unique association `.size` returns the wrong number.
2012-05-16 17:32:00 -07:00
Aaron Patterson
9c734c5135 Merge pull request #6358 from jfirebaugh/schema_define
Call methods on the correct instance in AR::Schema.define
2012-05-16 17:24:07 -07:00
Piotr Sarnacki
e2a070cf47 Fix CollectionAssociation#replace to return new target (closes #6231) 2012-05-16 17:22:44 -07:00
Radoslav Stankov
64872d1e34 Relation#from to accept other Relation objects
Record.from("(#{sub_query.to_sql})")    -> Record.from(sub_query)
Record.from("(#{sub_query.to_sql}) a")  -> Record.from(sub_query, :a)
2012-05-17 02:36:13 +03:00
Aaron Patterson
835df6f3ed Merge pull request #6192 from danmcclain/add_inet_and_cidr_types_to_postgresql_adapter
Add support for macaddr, inet, and cidr types to PostgreSQL adapter
2012-05-16 16:29:43 -07:00
Aaron Patterson
8e5f07dabc Merge pull request #5535 from markmcspadden/issue_5527_rollbacks
Allow manual rollbacks in after_save to reset object correctly
2012-05-16 16:06:49 -07:00
John Firebaugh
a57990ff51 Call methods on the correct instance in AR::Schema.define
Now that migrations support instance methods, we should
use the same instance rather than relying on delegation
to a global instance. This allows subclassing AR::Schema.
2012-05-16 15:19:59 -07:00
Aaron Patterson
d6e4c06a8a assuming there is only one column, we can simplify the type cast loop 2012-05-16 14:16:57 -07:00
Aaron Patterson
2a38fd58a9 MySQL returns "SUM(DISTINCT(credit_limit))" as the column name unless
an alias is provided.  Without the alias, the column cannot be found
and properly typecast.
2012-05-16 14:07:10 -07:00
Mark Rushakoff
6a1290064d Fix typos in docs for ActiveRecord::Core::arel_table [ci skip] 2012-05-16 13:18:08 -07:00
Aaron Patterson
2a67a8cc59 Merge pull request #6136 from mhfs/sqlbypass_fixes
Bring SqlByPassTest to light and fix broken tests
2012-05-16 11:27:24 -07:00
Aaron Patterson
4025efb53b Merge pull request #6349 from erichmenge/patch-raise-type-errors
Integer limit out of range should be allowed to raise. Closes #6272
2012-05-16 11:25:43 -07:00
Carlos Antonio da Silva
aa964204b8 Merge pull request #6336 from erichmenge/patch-pluck-fragment
Fixes issue where SQL fragments prevented type casting based on column
2012-05-16 11:17:04 -07:00
Erich Menge
c90f16da62 Fixes issue where SQL fragments prevented type casting based on column type. 2012-05-16 12:02:02 -05:00
Erich Menge
56cef492c6 Integer limit out of range should be allowed to raise. Closes #6272 2012-05-16 07:46:01 -05:00
Piotr Sarnacki
4edb497676 Remove unneeded tests 2012-05-16 00:40:46 -07:00
Vijay Dev
80ba7a8bac Merge pull request #6347 from avakhov/ar-changelog-misprint
Fix misprint in AR changelog
2012-05-15 23:56:23 -07:00
Piotr Sarnacki
57d534ee9e Merge pull request #6344 from erichmenge/patch_sqlite_time_type
SQLite3 doesn't actually support the 'time' type.
2012-05-15 22:14:54 -07:00
Alexey Vakhov
2baa8ba953 Fix misprint in AR changelog 2012-05-16 09:06:57 +04:00
Alexey Vakhov
0e07a80f5a Update AR has_one association example 2012-05-16 09:00:26 +04:00
Oscar Del Ben
e8b809070d Remove useless check of adapter 2012-05-15 20:48:51 -07:00
Oscar Del Ben
8d7c38b858 Update docs in sqlite3 adapter 2012-05-15 20:38:41 -07:00