Commit Graph

26460 Commits

Author SHA1 Message Date
Santiago Pastorino
9be2353fac Sync AP CHANGELOG with 3-1-stable 2011-12-06 11:28:05 -02:00
Santiago Pastorino
e58d663f3e Merge pull request #3428 from adrianpike/asset_path_conflicts
Issue #3427 - asset_path_conflicts
2011-12-06 05:16:24 -08:00
José Valim
f0f0e59c10 Ensure length validator also works on 1.8.7. 2011-12-06 14:13:44 +01:00
José Valim
d722eb3b04 Merge pull request #3876 from tvdeyen/string_as_url_for_expire_action
Allow string as url for expire_action
2011-12-06 04:11:59 -08:00
Thomas von Deyen
0da31a1839 Allowing string as url argument for expire_action 2011-12-06 13:05:15 +01:00
José Valim
81fec5dfc4 Merge pull request #3872 from marcandre/i18n_key
ActiveModel::Name#i18n_key: Fix doc and add tests
2011-12-06 00:41:43 -08:00
José Valim
1ee832b2d8 Merge pull request #3873 from iangreenleaf/no_default_tokenizer
Don't tokenize string when counting characters
2011-12-06 00:41:05 -08:00
Marc-Andre Lafortune
d834755dad ActiveModel::Name#i18n_key: Fix doc and add tests 2011-12-05 22:02:53 -05:00
Aaron Patterson
a2f7c1dc67 make method signatures match the superclass signature 2011-12-05 18:36:27 -08:00
Aaron Patterson
b942ae836e return value is never tested, so stop calling presence 2011-12-05 18:36:08 -08:00
Adrian Pike
25007ad3fb Let's do the same trick for asset_path that we do for [image,javascript,stylesheet]_path to avoid namespace conflicts on named routes.
Closes #3427
2011-12-05 17:17:39 -08:00
Aaron Patterson
8aa7b8695d Quitoting the table name before querying. 2011-12-05 14:20:14 -08:00
Aaron Patterson
988061ddb8 Merge pull request #3867 from jadeforrest/master
Increase performance for table_exists?
2011-12-05 14:15:50 -08:00
José Valim
38185f670e Merge pull request #3866 from ugisozols/master
Remove .rxml, .rjs and .rhtml from source annotation regexp.
2011-12-05 12:31:37 -08:00
Uģis Ozols
d2f46d053f Remove .rxml, .rjs and .rhtml from source annotation regexp. 2011-12-05 21:24:09 +02:00
Jade Rubick
73a331c2ac Speed up table_exists? for databases with a large number of tables
At New Relic, we have hundreds of thousands of tables, and our migrations took 30 minutes without this similar patch. This cuts it down to a more reasonable amount of time.

The rescue false part is ugly, but necessary as far as I can tell. I don't know of a cross-database statement you can make that will work without trapping errors.
2011-12-05 11:20:10 -08:00
José Valim
f6cc4fd7a2 Merge pull request #3861 from andyjeffries/master
Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match)
2011-12-05 08:48:25 -08:00
José Valim
168c088735 Merge pull request #3863 from lest/params-wrapper-inflections
use classify in ParamsWrapper to derive model name from controller name
2011-12-05 08:46:10 -08:00
lest
1f0e21ce30 use classify in ParamsWrapper to derive model name from controller name 2011-12-05 19:15:36 +03:00
Andy Jeffries
71d769e3b5 Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match) 2011-12-05 15:41:38 +00:00
José Valim
d4964b3386 Namespaced attribute lookup now works as 'model/association.attribute'. 2011-12-05 15:39:41 +01:00
José Valim
2985151000 Merge pull request #3859 from kuroda/human_attribute_name
Fix human_attribute_name to handle names with dots
2011-12-05 06:09:33 -08:00
Tsutomu Kuroda
dff19f7be2 Fix human_attribute_name to handle names with dots
Nested I18n namespace lookup under activerecord.models is deprecated now (c19bd4f).
But when a model uses accepts_nested_attributes_for, its Errors object can have
an attribute name with "addresses.street" style. In this case, the dots should be
substituted with slashes so that we can provide the translation under the
"activemodel.attributes.person.addresses/street" key.
2011-12-05 22:57:47 +09:00
Xavier Noria
be482bd6d6 Merge pull request #3858 from Overbryd/redirect_to_url_with_network_path_reference
redirect_to url with network path reference: Do not escape forward slashes within a curly regexp
2011-12-05 02:55:08 -08:00
Overbryd
9fb5ee8beb Minor enhancement by not unnecessarely escaping forward slashing within a curly regexp and by mentoining the protocol relative scheme in the internal comment 2011-12-05 11:48:05 +01:00
José Valim
446bdb449d Merge pull request #3857 from Overbryd/redirect_to_url_with_network_path_reference
Fix for redirect_to to respect urls with a network path reference like "//asset.host.com/resources/1235"
2011-12-05 02:30:21 -08:00
Overbryd
e31c4ace97 Fix for redirect_to to respect urls with a network path reference like "//asset.host.com/resources/1235" see issue #3856 2011-12-05 11:19:48 +01:00
Ian Young
5ff71ac9f8 Don't tokenize string when counting characters 2011-12-04 23:20:54 -08:00
José Valim
cf6ccf0ebd Merge pull request #3854 from exviva/validates_associated_marked_for_destruction
Do not validate associated records marked for destruction
2011-12-04 15:57:13 -08:00
Olek Janiszewski
a8134aceb3 Do not validate associated records marked for destruction
The main reason for this change is to fix a bug where
`validates_associated` would prevent `accepts_nested_attributes_for`
with `allow_destroy: true` from destroying invalid associated records.
2011-12-05 00:19:21 +01:00
Jon Leighton
4ded0dd2de Merge pull request #3851 from ebeigarts/fix_sequence_name
Fix sequence name with abstract classes.
2011-12-04 15:19:17 -08:00
Xavier Noria
4e74bd194b moves some auto explain logic to the subscriber [José Valim & Xavier Noria] 2011-12-04 13:53:26 -08:00
Xavier Noria
7f3ce35e19 simplifies ActiveRecord::ExplainSubscriber [José Valim & Xavier Noria] 2011-12-04 13:27:03 -08:00
Xavier Noria
d59bfeb119 Merge branch 'explain' 2011-12-04 11:55:53 -08:00
Xavier Noria
cfeac38e2b implements a much faster auto EXPLAIN, closes #3843 [José Valim & Xavier Noria]
This commit vastly reduces the impact of auto
explain logging when enabled, while keeping
a negligible cost when disabled.

The first implementation was based on the idea
of subscribing to "sql.active_record" when
needed, and unsubscribing once done. This is
the idea behind AR::Relation#explain. Subscribe,
collect, unsubscribe.

But with the current implementation of notifications
unsubscribing is costly, because it wipes an internal
cache and that puts a penalty on the next event.

So we are switching to an approach where a long-running
subscriber is listening. Instead of collecting the
queries with a closure in a dedicated subscriber, now
we setup a thread local.

If the feature is disabled by setting the threshold
to nil, the subscriber will call a method that does
nothing. That's totally cheap.
2011-12-04 11:52:12 -08:00
José Valim
0ec0c9abe1 Merge pull request #3853 from nashby/form_for_as_option
form_for with :as option uses "action_as" as css class and id
2011-12-04 11:25:12 -08:00
Aaron Patterson
c24928c3ad Merge pull request #3845 from sumbach/test-return-value-from-require
Add tests for the return value of require
2011-12-04 11:22:09 -08:00
Vasiliy Ermolovich
e29773f885 form_for with +:as+ option uses "action_as" as css class and id 2011-12-04 22:12:24 +03:00
Vijay Dev
3134b467f0 Merge branch 'master' of github.com:lifo/docrails 2011-12-04 23:56:46 +05:30
Edgars Beigarts
82ae5c40ea Fix sequence name with abstract classes. 2011-12-04 20:10:14 +02:00
José Valim
91a3e92cc2 Merge pull request #3850 from carlosantoniodasilva/readonly-attributes
Refactor readonly attributes conditional
2011-12-04 04:46:59 -08:00
Carlos Antonio da Silva
4e836e4de9 Refactor readonly attributes conditional 2011-12-04 09:21:34 -02:00
Vijay Dev
69341d3686 copy edits in the migrations guide 2011-12-04 16:29:11 +05:30
Xavier Noria
5dfdc69ef9 Merge pull request #3848 from arunagw/sqlite3_bump
SQlite3 Bump
2011-12-04 01:56:50 -08:00
Arun Agrawal
ac4763f5c0 SQlite3 Bump 2011-12-04 10:27:44 +05:30
Jason Noble
95213ac477 Be explicit about where to add/remove stuff to the migration 2011-12-03 19:31:45 -07:00
Jason Noble
b6d7ce9f23 Fix missing /ruby block 2011-12-03 19:31:45 -07:00
Jason Noble
718d0ea985 Be explicit of where the constraints are. 2011-12-03 19:31:45 -07:00
Jason Noble
914b85f124 Improve readability 2011-12-03 19:31:44 -07:00
Jason Noble
452b624e1e Be more friendly than "shut up" 2011-12-03 19:31:44 -07:00