Commit Graph

44822 Commits

Author SHA1 Message Date
Kalman Hazins
1a69112d6a Update migrations.md
default column type modifier
2014-06-08 10:29:57 -04:00
Matthew Draper
c9a43126c5 Ignore distressingly-frequent segfaults on this build
Not sure what's causing them suddenly, but it seems unlikely there's
much we can do about it. For the small amount of coverage this
particular job gains us, it's hurting us more, by making CI failures
unremarkable.
2014-06-08 23:42:01 +09:30
Yves Senn
71f99be858 Merge pull request #15545 from zuhao/refactor_actionpack_assert_select_test
Restore test deliveries for ActionMailer.
2014-06-08 15:55:20 +02:00
Matthew Draper
376eefaa47 Merge pull request #15452 from matthewd/live-abort
Handle client disconnect during live streaming
2014-06-08 22:53:00 +09:30
Matthew Draper
6a89850dfe Handle client disconnect during live streaming
.. even when the producer is blocked for a write.
2014-06-08 07:21:14 +09:30
Rafael Mendonça França
a235105a5b Merge pull request #15567 from aditya-kapoor/add-cases
Add Additional Test Cases for the constantize
2014-06-07 17:55:43 -03:00
Aditya Kapoor
885ebda266 Add Missing Test Cases for the constantize 2014-06-07 23:58:38 +05:30
Rafael Mendonça França
1d96915bba Merge pull request #15566 from kuldeepaggarwal/fix-build
fix test cases after #15558 merge to master.
2014-06-07 15:27:39 -03:00
Kuldeep Aggarwal
3d4ca490d8 fix test cases after #15558 merge to master. 2014-06-07 23:52:51 +05:30
Rafael Mendonça França
cf94a551dc Merge pull request #15558 from sgrif/sg-rename-property
Rename `property` to `attribute`

Conflicts:
	activerecord/lib/active_record/attribute_methods/serialization.rb
	activerecord/lib/active_record/base.rb
2014-06-07 15:12:24 -03:00
Rafael Mendonça França
4cf63ce373 Merge pull request #15546 from sgrif/sg-lazy-decorators
Don't query the database schema when calling `serialize`
2014-06-07 15:09:23 -03:00
Rafael Mendonça França
dc73e39b4d Merge pull request #15561 from sgrif/sg-time-zone-aware-arrays
Ensure time zones don't change after round trip with array columns
2014-06-07 14:57:04 -03:00
Rafael Mendonça França
c6e166b25e Merge pull request #15562 from sgrif/sg-double-type-cast-dirty
Do not type cast twice on attribute assignment
2014-06-07 14:52:30 -03:00
Sean Griffin
368cca51d2 Do not type cast twice on attribute assignment
The definition of `write_attribute` in dirty checking ultimately leads
to the columns calling `type_cast` on the value to perform the
comparison. However, this is a potentially expensive computation that we
cache when it occurs in `read_attribute`. The only case that we need the
non-type-cast form is for numeric, so we pass that through as well
(something I'm looking to remove in the future).

This also reduces the number of places that manually access various
stages in an attribute's type casting lifecycle, which will aid in one
of the larger refactorings that I'm working on.
2014-06-07 11:46:58 -06:00
Rafael Mendonça França
d95bcc9f12 Merge pull request #15560 from aditya-kapoor/guide-fixes
Correct Example output in Rails guides [ci skip]
2014-06-07 14:42:40 -03:00
Rafael Mendonça França
263774f045 Merge pull request #15564 from sgrif/sg-remove-dead-code
Remove dead branch when restoring ID within a transaction

Conflicts:
	activerecord/lib/active_record/transactions.rb
2014-06-07 14:33:59 -03:00
Rafael Mendonça França
db5415dd4f Merge pull request #15565 from sgrif/sg-no-unfreezing
Move conditionals about freezing closer to the definition of `freeze`
2014-06-07 14:09:31 -03:00
Sean Griffin
105e0304b9 Move conditionals about freezing closer to the definition of freeze
Reduces the number of places that care about the internals of how we
store and type cast attributes. We do not need to go through the
dup/freeze dance, as you couldn't have saved a frozen new record anyway,
and that is the only time we would end up modifying the frozen hash.
2014-06-07 11:03:36 -06:00
Sean Griffin
35164093f5 Remove dead branch when restoring ID within a transaction
There is no way to have an instance of an Active Record model where
`has_attribute?(self.class.primary_key)` returns false. The record is
always initialized in such a way that `@raw_attributes` will have an id
key with nil for the value.
2014-06-07 10:23:25 -06:00
Rafael Mendonça França
287e926d56 Merge pull request #15563 from sgrif/sg-raw-attributes-access
Remove duplicated `@raw_attributes.keys`
2014-06-07 13:05:46 -03:00
Sean Griffin
e1f33110e8 Remove duplicated @raw_attributes.keys
Reduces the number of things outside of attribute methods that cares
about the details of how we store and type cast attributes
2014-06-07 09:55:28 -06:00
Sean Griffin
3b22df2350 Ensure time zones don't change after round trip with array columns
The times would be equivalent, even if they were in different time
zones. E.g. 12:00 UTC == 5:00 PDT
2014-06-07 09:38:15 -06:00
Matthew Draper
2f5fab8d5a Merge pull request #15557 from sgrif/sg-specify-time-zone
Specify a time zone when testing TZ aware attributes
2014-06-08 01:03:06 +09:30
Sean Griffin
da9ed153f7 Don't rely on Time.current in tests
Millisecond inequality causes failures on Travis
2014-06-07 09:31:59 -06:00
Aditya Kapoor
269ad13be7 Correct Example output in Rails guides [ci skip] 2014-06-07 20:58:29 +05:30
Yves Senn
16f595f1b6 changelog for #15556 and credit @kuldeepaggarwal [Kuldeep Aggarwal]
This is a follow up to #15556

@kuldeepaggarwal did submit this patch way back (#13624).
2014-06-07 16:26:28 +02:00
Sean Griffin
3fab9d8821 Rename property to attribute
For consistency with https://github.com/rails/rails/pull/15557
2014-06-07 07:20:25 -06:00
Sean Griffin
2dca1ba039 Don't query the database schema when calling serialize
We need to decorate the types lazily. This is extracted to a separate
API, as there are other refactorings that will be able to make use of
it, and to allow unit testing the finer points more granularly.
2014-06-07 07:03:42 -06:00
Yves Senn
23a751c2e1 Merge pull request #15556 from sgrif/sg-time-zone-aware-arrays
Add array support when time zone aware attributes are enabled
2014-06-07 14:44:12 +02:00
Sean Griffin
1c181c2950 Add array support when time zone aware attributes are enabled 2014-06-07 06:43:39 -06:00
Xavier Noria
f84d081faf adds some details to the rationale of converted_arrays [ci skip] 2014-06-07 13:30:03 +02:00
Xavier Noria
f712f89961 adds a regression test for the strong params converted arrays cache
This is a regression test for 29844dd.
2014-06-07 13:19:16 +02:00
Xavier Noria
1ecada20d1 Revert "Convert StrongParameters cache to a hash. This fixes an unbounded"
We cannot cache keys because arrays are mutable. We rather want to cache
the arrays. This behaviour is tailor-made for the usage pattern strongs
params is designed for.

In a forthcoming commit I am going to add a test that covers why we need
to cache by value.

Every strong params instance has a live span of a request, the cache goes
away with the object. Since strong params have such a concrete intention,
it would be interesting to see if there are actually any real-world use
cases that are an actual leak, one that practically may matter.

I am not convinced that the theoretical leak has any practical consequences,
but if it can be shown there are, then I believe we should either get rid of
the cache (which is an optimization), or else wipe it in the mutating API.

This reverts commit e63be2769c039e4e9ada523a8497ce3206cc8a9b.
2014-06-07 13:19:16 +02:00
Vijay Dev
a39c88b5c9 copy edits [ci skip] 2014-06-07 10:53:25 +00:00
Vijay Dev
b9ea1d3384 Merge branch 'master' of github.com:rails/docrails 2014-06-07 10:05:23 +00:00
Xavier Noria
ad539dcb30 Merge pull request #15555 from akshay-vishnoi/doc_changes
Fix capitalization
2014-06-07 02:17:25 -07:00
Akshay Vishnoi
b6760d8f14 [ci skip] Fix capitalization 2014-06-07 14:23:27 +05:30
Arthur Nogueira Neves
a6c8cde835 Merge pull request #15542 from Gaurav2728/gaurav-remove_shutdown_link
remove rubyforge.org that was shut down [ci skip]
2014-06-06 19:50:54 -05:00
Matthew Draper
fadbc7c9ee Unwrap another html_escape
/cc @tenderlove
2014-06-07 10:13:00 +09:30
Rafael Mendonça França
2cdf73023c Merge pull request #15554 from sgrif/sg-klass
Removed unused `klass` definitions from types
2014-06-06 21:11:37 -03:00
Sean Griffin
8a6e7631d3 Removed unused klass definitions from types
Only `Date` and `Time` are handled.
2014-06-06 17:35:00 -06:00
Aaron Patterson
17fc6f16eb eliminate more wasteful allocations 2014-06-06 15:29:03 -07:00
Rafael Mendonça França
a8a6f85a1b Merge pull request #15552 from sgrif/sg-remove-klass-special-case
Remove composed_of special case from multi-parameter attributes
2014-06-06 18:38:16 -03:00
Rafael Mendonça França
43697f4fe5 Merge pull request #15551 from sgrif/sg-numeric-types
Don't mess with `_before_type_cast` for numeric types
2014-06-06 17:33:08 -03:00
Sean Griffin
36e9be8524 Remove composed_of special case from multi-parameter attributes
As we move towards removing the `klass` method from `column`, the else
clause as it stands right now will become the only case.
2014-06-06 14:24:16 -06:00
Sean Griffin
332d6c9b6f Don't mess with _before_type_cast for numeric types 2014-06-06 13:53:13 -06:00
Aaron Patterson
092f74080c remove another wasteful AS::SafeBuffer allocation 2014-06-06 12:06:58 -07:00
Aaron Patterson
e9f215d9f2 eliminate wasteful AS::SafeBuffer allocation 2014-06-06 12:06:04 -07:00
Rafael Mendonça França
a0aebc0dfb Revert "Merge pull request #15550 from sgrif/sg-numeric-types"
This reverts commit be1db9946616a4005bb7be45656cc0f84d75d915, reversing
changes made to 6680ee9427ae2639e404cd3b9538f54e136057c6.

Reason: This changed a behavior where numeric attributes when receiving
blank values didn't change its value.
2014-06-06 16:02:39 -03:00
Rafael Mendonça França
be1db99466 Merge pull request #15550 from sgrif/sg-numeric-types
Don't mess with `_before_type_cast` for numeric types
2014-06-06 15:30:49 -03:00