Commit Graph

26365 Commits

Author SHA1 Message Date
Sam Umbach
93580f4936 Test return value of ActiveSupport::Dependencies::Loadable#require
- Add tests to protect from regressions in require's return value behavior
- See a10606c490471d8e1483acb3b31d7f2d51e9ebbe (require needs to return true or false) for the original bug fix
2011-12-03 11:52:25 -05:00
Vijay Dev
baa93a1c2e Merge branch 'master' of github.com:lifo/docrails 2011-12-02 23:43:52 +05:30
Vijay Dev
f402ef5766 rephrase doc on explain threshold 2011-12-02 23:41:50 +05:30
Arun Agrawal
3d550e5174 Added doc about pluck for active_support core ext 2011-12-02 23:15:08 +05:30
Xavier Noria
31a3124f05 Merge pull request #3832 from arunagw/indentation
indentation fix warning
2011-12-02 09:29:26 -08:00
Arun Agrawal
9a59475d4a indentation fix warning 2011-12-02 22:55:15 +05:30
Xavier Noria
36cc1f78eb revises some details in the previous explain patch 2011-12-02 09:19:13 -08:00
Jon Leighton
9acb340e88 Revert "Roflscaling!" (for now)
This reverts commit f6b5046305d43c5f64bcb6fed0e44f7bca99a603.

Fear not, the roflscale will return when I have a bit more time and
figure out a better way to do it. (In particular, a way that doesn't
break the build.)
2011-12-02 13:23:31 +00:00
Xavier Noria
0306f82e0c implements automatic EXPLAIN logging for slow queries 2011-12-02 04:35:43 -08:00
David Heinemeier Hansson
4d20de8a50 Added Enumerable#pluck to wrap the common pattern of collect(&:method) *DHH* 2011-12-02 13:00:56 +01:00
José Valim
76a3ec7f6e Try to play nice with plugins doing monkey patches. 2011-12-02 09:57:43 +01:00
Arun Agrawal
9f623e2109 [Docs] Information about ActionDispatch::DebugExceptions in rake task 2011-12-02 08:45:11 +05:30
Arun Agrawal
330db28018 Adding information about ActionDispatch::DebugExceptions 2011-12-02 08:44:32 +05:30
Jon Leighton
6bff6439b1 Fewer string allocations in attribute method 2011-12-01 23:41:51 +00:00
Jon Leighton
f6b5046305 Roflscaling!
Don't prefix the name with attribute_. Avoids a string allocation on
read_attribute, which is a bit faster.
2011-12-01 23:41:51 +00:00
Jon Leighton
9ead4130de Create method with known identifier then alias into place.
This means we never have to rely on define_method (which is slower and
uses more memory), even when we have attributes containing characters
that are not allowed in standard method names.

(I am mainly changing this because the duplication annoys me, though.)
2011-12-01 23:41:51 +00:00
Jon Leighton
bd920eae82 Remove some unnecessary code etc 2011-12-01 23:41:51 +00:00
Jon Leighton
e9fb6d04bd Add test for read_attribute(:id) with non-standard PK.
Also make it actually work.

It slows down all read_attribute accesses to map 'id' to whatever the PK
actually is, inside read_attribute. So instead make sure the necessary
methods are defined and that they redirect wherever they need to go.
2011-12-01 23:41:51 +00:00
Jon Leighton
f1a534af98 Remove the need for type_cast_attribute.
This is good because it reduces duplication.
2011-12-01 23:41:51 +00:00
Jon Leighton
47b97a739d Fix up test altering global state that was causing me grief 2011-12-01 23:41:51 +00:00
Jon Leighton
3a40d38619 Get rid of the underscore versions of attribute methods!
This makes me happy!
2011-12-01 23:41:51 +00:00
Jon Leighton
3dcb127109 Don't rely on underscore-prefixed attribute methods.
Define singleton methods on the attributes module instead. This reduces
method pollution on the actual model classes. It also seems to make
something faster, I am unsure why! O_o
2011-12-01 23:41:51 +00:00
Jon Leighton
365e10b8dc Remove unnecessary *args 2011-12-01 23:41:51 +00:00
Richard Hulse
d72a85c022 [docs] removed last-modifed line from examples
This is no longer best-practice.

ref:
http://stackoverflow.com/questions/8344186/rails-3-1-on-apache-pagespeed-says-specify-cache-validator-when-using-asset-p/8348385#8348385
2011-12-02 10:44:34 +13:00
José Valim
07f90f6bec Merge branch 'exceptions' with the following features:
* A Railtie API for registering new exceptions and their respective status code (check Active Record railtie for an example)

* Extraction of ShowExceptions middleware logging and debugging features into a middleware called DebugExceptions

Conflicts:
	actionpack/CHANGELOG.md
2011-12-01 21:18:47 +01:00
José Valim
6a4606d3a6 Remove unnecessary test setup. 2011-12-01 21:17:11 +01:00
José Valim
f9edc079e0 Split and improve show and debug exceptions middlewares. 2011-12-01 21:15:42 +01:00
José Valim
750bb5c865 Split ShowExceptions responsibilities in two middlewares. 2011-12-01 20:46:18 +01:00
David Heinemeier Hansson
83d29a283c Revert "Added ActiveRecord::Base#last_modified to work with the new fresh_when/stale? conditional get methods from Action Pack"
Needless indirection with no added value.

This reverts commit 535853e83b9092078035a5abb2aa242fba815c05.
2011-12-01 20:45:47 +01:00
José Valim
956ecff833 Add a deprecation to old show exceptions API (even though it was not public). 2011-12-01 20:16:12 +01:00
José Valim
0b677b18ff Add an ExceptionWrapper that wraps an exception and provide convenience helpers. 2011-12-01 20:02:00 +01:00
David Heinemeier Hansson
535853e83b Added ActiveRecord::Base#last_modified to work with the new fresh_when/stale? conditional get methods from Action Pack 2011-12-01 19:47:14 +01:00
José Valim
b4359bc723 Allow rescue responses to be configured through a railtie. 2011-12-01 19:21:35 +01:00
David Heinemeier Hansson
218c272938 Allow fresh_when/stale? to take a record instead of an options hash [DHH] 2011-12-01 19:16:10 +01:00
Tim Sjoberg
bb2adab79b fixed finger-dyslexia in active_support core extensions guide 2011-12-01 14:27:51 +02:00
José Valim
1e51cd957e Update CHANGELOG. 2011-12-01 13:22:28 +01:00
José Valim
f8b934224f Merge pull request #3660 from jdelStrother/asset_protocol
default_asset_host_protocol should not default to :relative
2011-12-01 04:18:41 -08:00
Jonathan del Strother
88237daae4 Leave default_asset_host_protocol unset
When default_asset_host_protocol is left as nil, it will use absolute protocols when a request is present, and relative protocols otherwise (eg in asset generation)
2011-12-01 11:57:33 +00:00
José Valim
cb7145700d Merge pull request #3823 from avakhov/av-length-validation-exception-msg-fix
Fix argument error message for length validation
2011-11-30 22:09:56 -08:00
Alexey Vakhov
814a4c3160 Fix argument error message for length validation 2011-12-01 09:12:16 +04:00
Jon Leighton
52eedf5e2b Add hackery to make Syck use encode_with/init_with. Fixes 1.8 after recent changes to attribute serialization. 2011-12-01 01:15:16 +00:00
Jon Leighton
1c783c6040 don't alter global state in test 2011-11-30 23:47:16 +00:00
Julius de Bruijn
4e380828ff If the table behind has no primary key, do not ask again and just return nil. 2011-11-30 23:47:16 +00:00
Jon Leighton
7a4949e7d5 consistency 2011-11-30 23:18:41 +00:00
Jon Leighton
d5f7884dc5 Don't check column type, you might implement a custom coder that serializes to a different type 2011-11-30 23:18:40 +00:00
Jon Leighton
7895182d0f omg computer science!
Implement a mini state machine for serialized attributes. This means we
do not have to deserialize the values upon initialization, which means
that if we never actually access the attribute, we never have to
deserialize it.
2011-11-30 23:18:40 +00:00
Jon Leighton
4f20eb5908 Fix typo 2011-11-30 23:18:40 +00:00
Jon Leighton
035b4244ba Don't need second param 2011-11-30 23:18:40 +00:00
Jon Leighton
efcc95acb7 No longer need to undef id as we are defining it ourselves 2011-11-30 23:18:40 +00:00
Jon Leighton
6c63f1aa44 Move some serialization stuff out of Base 2011-11-30 23:18:40 +00:00