Commit Graph

169 Commits

Author SHA1 Message Date
Rafael Mendonça França
dab58bee2a Merge pull request #10096 from benofsky/fix_skipping_object_callback_filters
Fixes skipping object callback filters
2013-04-21 21:19:18 -07:00
Daniel Schierbeck
5f07048dfd Extract a base class from ActiveSupport::LogSubscriber
Adds a ActiveSupport::Subscriber base class that LogSubscriber inherits
from. By inheriting from Subscriber, other kinds of subscribers can take
advantage of the event attachment system.
2013-04-16 14:39:22 +02:00
Yves Senn
c245437de7 use unified and clean formatting in CHANGELOGS. [ci skip] 2013-04-12 15:52:43 +02:00
Vijay Dev
b15ce4a006 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	guides/source/action_mailer_basics.md
2013-04-11 22:58:14 +05:30
Agis Anastasopoulos
0974b392ef Fix markdown formatting 2013-04-06 21:13:59 +03:00
Agis-
941986c7db Add option to Class#class_attribute for skipping the query method 2013-04-06 20:34:13 +03:00
Aaron Patterson
dfdc1e31a2 fast_xs support has been removed. Use 'String#encode(xml: :attr)`. 2013-04-05 22:31:17 -07:00
Ben McRedmond
8e1d3cd490 Fixes skipping object callback filters
This allows you to skip callbacks that are defined by objects, e.g. for
`ActionController`:

    skip_after_filter MySpecialFilter

Previously this didn't work due to a bug in how Rails compared callbacks
in `Callback#matches?`. When a callback is compiled, if it's an object
filter (i.e. not a method, proc, etc.), `Callback` now defines a method on
`@klass` that is derived from the class name rather than `@callback_id`.
So, when `skip_callback` tries to find the appropriate callback to
remove, `Callback` can regenerate the method name for the filter
object and return the correct value for `Callback#matches?`.
2013-04-04 16:11:13 -07:00
Rafael Mendonça França
49a0f554a6 Revert "Merge pull request #10034 from benofsky/fix_skipping_object_callback_filters"
This reverts commit c79c6980647eb76bfa52178711fb04ba7e9d403b, reversing
changes made to ba4c27479add60b783a0e623c8a5d176c1dc9043.

This broke all the tests. See https://travis-ci.org/rails/rails/builds/6061839
2013-04-04 18:19:55 -03:00
Ben McRedmond
e377228342 Fixes skipping object callback filters
This allows you to skip callbacks that are defined by objects, e.g. for
`ActionController`:

    skip_after_filter MySpecialFilter

Previously this didn't work due to a bug in how Rails compared callbacks
in `Callback#matches?`. When a callback is compiled, if it's an object
filter (i.e. not a method, proc, etc.), `Callback` now defines a method on
`@klass` that is derived from the class name rather than `@callback_id`.
So, when `skip_callback` tries to find the appropriate callback to
remove, `Callback` can regenerate the method name for the filter
object and return the correct value for `Callback#matches?`.
2013-04-04 11:45:13 -07:00
Vijay Dev
e63086c135 Merge branch 'master' of github.com:rails/rails 2013-03-30 15:47:38 +05:30
Vijay Dev
6d8c070821 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
	activerecord/test/cases/adapter_test.rb
	guides/source/testing.md

[ci skip]
2013-03-30 15:46:14 +05:30
Vijay Dev
06e22c01e8 Revert "Using American English spellings over British style spellings"
This reverts commit 573df1cf2a5d5d1f288c8a4a5d76194675141832.

Reason: changelog edits aren't allowed in docrails.

[ci skip]
2013-03-30 15:12:23 +05:30
Rafael Mendonça França
57fbcc5247 Merge pull request #9523 from stopdropandrew/Instrumenter#instrument-yields-payload
ActiveSupport::Notifications::Instrumenter#instrument should yield

Conflicts:
	activesupport/CHANGELOG.md
2013-03-27 17:43:33 -03:00
Prathamesh Sonpatki
573df1cf2a Using American English spellings over British style spellings 2013-03-21 20:41:45 +05:30
Yves Senn
836ea9fb42 TimeWithZone raises NoMethodError in proper context.
Closes #9772.

`TimeWithZone` delegates everything to the wrapped `Time` object
using `method_missing`. The result is that `NoMethodError` error
will be raised in the context of `Time` which leads to a misleading
debug output.
2013-03-18 17:41:34 +01:00
Steve Klabnik
feaa6e2048 Revert "Merge pull request #8156 from fredwu/acronym_fix-master"
This reverts commit 867dc1700f32aae6f98c4651bd501597e6b52bc0, reversing
changes made to 9a421aaa8285cf2a7ecb1af370748b0337818930.

This breaks anyone who's using ForceSSL: https://travis-ci.org/rails-api/rails-api/jobs/5556065

Please see comments on #8156 for some discussion.
2013-03-16 15:25:49 -07:00
Xavier Noria
e958eabeb1 revises the CHANGELOG entry from 26aa265 [ci skip] 2013-03-16 16:03:09 +01:00
Fred Wu
26aa26564d Added Inflector#underscore fix to the changelog 2013-03-17 00:32:28 +11:00
Yves Senn
f8b0e54939 CHANGELOG entry for improved singularizing of singulars.
Closes #9559.

The actual patch was added with #4719
2013-03-06 08:28:23 +01:00
stopdropandrew
a007800a55 ActiveSupport::Notifications::Instrumenter#instrument should yield
its payload the same way that ActiveSupport::Notifications does.
Fix spelling in test name.
2013-03-02 16:05:05 -08:00
Steve Klabnik
5112a6ccdf Move AS CHANGELOG entry up.
I merged b883706 but forgot to move the entry past beta1.
2013-02-26 11:21:37 -08:00
Steve Klabnik
95883ca4b1 Merge pull request #9329 from chuckbjones/fix-cache-delete-rc
Fix deletion of empty directories
2013-02-26 11:15:29 -08:00
Rafael Mendonça França
0f75e2c51f Update CHANGELOGS 2013-02-26 13:45:57 -03:00
Charles Jones
b8837066dc Fix deletion of empty directories:
1. When comparing the directory to delete against the top level
   cache_path, use File.realpath to make sure we aren't comparing two
   unequal strings that point to the same path. This occurs, for
   example, when cache_path has a trailing slash, which it does in the
   default Rails configuration. Since the input to
   delete_empty_directories never has a trailing slash, the comparison
   will never be true and the top level cache directory (and above) may
   be deleted. However…

2. File.delete raises EPERM when trying to delete a directory, so no
   directories have ever been deleted. Changing the code to Dir.delete
   fixes that.
2013-02-25 18:54:44 -06:00
David Heinemeier Hansson
c0bc9ce38c Preparing for 4.0.0.beta1 release 2013-02-25 08:31:50 -06:00
Chris Baynes
fa891a2b9d Keep second fraction when DateTime#change is called. 2013-02-25 11:05:49 +01:00
Rafael Mendonça França
51e963790f Add more information to the CHANGELOG entry [ci skip] 2013-02-24 18:36:45 -03:00
stopdropandrew
cb100ca02b Added ActiveSupport::TimeWithZone#to_r for Time#at compatibility. 2013-02-24 13:24:50 -08:00
Xavier Noria
1509844cdd did a pass over the AS changelog [ci skip] 2013-02-24 21:26:02 +01:00
Carlos Antonio da Silva
1fbfdf5e1b Changelog improvements, use 1.9 style hash in examples [ci skip] 2013-02-22 19:44:50 -03:00
hoffm
4e3ceedeba Address edge case for number_to_human with units option.
ActiveSupport::NumberHelper#number_to_human now returns the number unaltered when
the units hash does not contain the needed key, e.g. when the number provided is less
than the largest key provided.
2013-02-22 08:25:51 -05:00
Gagan Awhad
6f380d3778 Added beginning_of_minute support to core_ext calculations for Time and DateTime 2013-02-21 16:14:16 -06:00
Xavier Noria
20ed3e0f71 moves the new :nsec date format to the Active Support changelog [ci skip] 2013-02-20 18:08:55 +01:00
Beyond
d59a877da4 added compress options for gzip
added test for compress options of gzip

update changelog
2013-02-10 20:01:42 +09:00
Carlos Antonio da Silva
2f0c26bf59 Update changelog from #9128 with author name
And improve AS changelog a bit [ci skip]
2013-02-06 19:02:40 -02:00
James Harton
28ab79d7c5 Modify TimeWithZone#as_json to return 3DP of sub-second accuracy by default, since it's allowed by the spec and is very useful. 2013-01-31 14:11:51 +13:00
Carlos Antonio da Silva
68f69ec31e Move AS changelog entry to the top, improve AP changelog a bit
[ci skip]
2013-01-28 19:40:18 -02:00
Antoine Lyset
b5245da94a Improve String#squish whitespaces matching 2013-01-22 22:46:11 +01:00
Andrew White
b79adc4323 Standardise the return value of to_time
This commit standardises the return value of `to_time` to an instance
of `Time` in the local system timezone, matching the Ruby core and
standard library behavior.

The default form for `String#to_time` has been changed from :utc to
:local but research seems to suggest the latter is the more common form.

Also fix an edge condition with `String#to_time` where the string has
a timezone offset in it and the mode is :local. e.g:

  # Before:
  >> "2000-01-01 00:00:00 -0500".to_time(:local)
  => 2000-01-01 05:00:00 -0500

  # After:
  >> "2000-01-01 00:00:00 -0500".to_time(:local)
  => 2000-01-01 00:00:00 -0500

Closes #2453
2013-01-21 12:33:49 +00:00
Yves Senn
3e1ed7818b extract PerformanceTest into rails-performance_tests gem 2013-01-10 17:09:06 +01:00
Jeremy Kemper
46e0d2397e CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml. 2013-01-08 12:42:29 -08:00
Jeremy Kemper
c31cc963da Revert "Merge branch 'master-sec'"
This reverts commit 88cc1688d0cb828c17706b41a8bd27870f2a2beb, reversing
changes made to f049016cd348627bf8db0d72382d7580bf802a79.
2013-01-08 12:41:04 -08:00
Jeremy Kemper
2ced6f2f8a CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml. 2013-01-08 12:03:34 -08:00
Yves Senn
947e1d5e85 deprecate assert_blank and assert_present.
They don't add any benefits over `assert object.blank?`
and `assert object.present?`
2013-01-05 18:04:52 +01:00
Carlos Antonio da Silva
149b86d97b Move changelog entry in railties to the top
Other minor changelog improvements [ci skip]
2013-01-04 22:49:14 -02:00
Kelly Stannard
ebd27d5714 Better error message for String#to_date
I did this because to_date gives a very unhelpful error message if you
do not pass in a correct date. In the process I think this cleans up the
 code nicely and even better it tends to be slightly faster than the
 current implementation.

Benchmark
https://gist.github.com/4440875
2013-01-04 16:39:18 +00:00
bUg
38f28dca3a Added ability to compare date/time with infinity
Date, DateTime, Time and TimeWithZone can now be compared to infinity,
  so it's now possible to create ranges with one infinite bound and
  date/time object as another bound.

  Ex.: @range = Range.new(Date.today, Float::INFINITY)

Also it's possible to check inclusion of date/time in range with
  conversion.

  Ex.: @range.include?(Time.now + 1.year) # => true
       @range.include?(DateTime.now + 1.year) # => true

Ability to create date/time ranges with infinite bound is required
  for handling postgresql range types.
2013-01-04 02:41:09 +01:00
Carlos Antonio da Silva
9f200fb296 Changelog improvements [ci skip] 2013-01-02 21:11:11 -02:00
Akira Matsuda
b6aa59368b missing changelog entry for #8682 2013-01-02 19:19:33 -03:00