Commit Graph

4447 Commits

Author SHA1 Message Date
Akira Matsuda
f89fa2ae71 Model.all alone does nothing 2013-01-04 04:22:30 +09:00
Matthew Stopa
4928bdee27 Add documentation for BacktraceCleaner#remove_filters! 2013-01-02 21:17:38 -07:00
Matthew Stopa
a4eaecc833 Add more documentation to TimeWithZone
[ci skip]
2013-01-01 09:55:28 -07:00
Vijay Dev
dfc930b2b1 Merge branch 'master' of github.com:lifo/docrails 2013-01-01 20:29:43 +05:30
Vijay Dev
a30eae10e4 copy edits [ci skip] 2013-01-01 20:28:34 +05:30
Matthew Stopa
f42c089311 Add documentation for TimeWithZone methods 2012-12-31 22:52:47 -07:00
Matthew Stopa
6d5385a135 Add documentation for the TimeWithZone#dst? method.
[ci skip]
2012-12-31 19:05:59 -07:00
Andrew Nesbitt
d814284506 Updated copyright notices for 2013 2012-12-31 20:35:29 +00:00
Rafael Mendonça França
e6e3a64982 Only call MiniTest.autorun if the dependecy is present 2012-12-31 16:25:07 -03:00
Rafael Mendonça França
5294ad82c6 Alias refute methods to assert_not and perfer assert_not on tests 2012-12-31 13:58:52 -03:00
Rafael Mendonça França
d4c94accf7 Remove unneeded tests
These tests are needed only if we are using MiniTest::Spec
2012-12-31 13:57:24 -03:00
Rafael Mendonça França
5da4d5142a Add active_support/testing/autorun
minitest/autorun load minitest/spec polluting the global namespace with
the DSL that we don't want on Rails
2012-12-31 13:57:24 -03:00
Rafael Mendonça França
eb4930e3c7 Inherit from MiniTest::Unit::TestCase instead of MiniTest::Spec 2012-12-31 13:57:23 -03:00
Rafael Mendonça França
d58d71f565 Revert "minitest provides "it" and "describe""
This reverts commit 22bc12ec374b8bdeb3818ca0a3eb787dd3ce39d8.

REASON: We will remove the MiniTest::Spec from Rails and we need these
methods again

Conflicts:
	activesupport/lib/active_support/test_case.rb
2012-12-31 13:57:23 -03:00
Jeremy Kemper
8a130ece7e Test that assert_not returns true. Use assert_raises instead of doing begin/rescue/else. 2012-12-28 21:47:42 -07:00
Steve Klabnik
90397de416 Merge pull request #8641 from arunagw/warning_removed_unused_var
Remove 'assigned but unused variable' warning
2012-12-28 09:57:47 -08:00
Arun Agrawal
f71aa354be Remove 'assigned but unused variable' warning 2012-12-28 23:14:59 +05:30
Jeremy Kemper
f75addd06b Introduce assert_not to replace 'assert !foo' 2012-12-28 10:34:26 -07:00
Yves Senn
e68505a41a rewrite order dependent test case. #8185
As reported (https://github.com/rails/rails/pull/8185#issuecomment-11702226)
this test relied on the order a hash was serialized. Comparing the parsed
hash makes the test no longer order dependent.
2012-12-27 17:28:42 +01:00
Jeremy Kemper
b82109495b Make test logs easier to read.
Tagging every message in tests makes the logs really wide. It's great
for grepping, but annoying to open in an editor or a narrow terminal.
Try out a different approach: spit out a heading before each test.
2012-12-26 21:16:05 -07:00
Yves Senn
8787c6e0e5 deprecation warning when BufferedLogger is instantiated 2012-12-25 20:21:14 +01:00
Yves Senn
433ebbdc4c ActiveSupport::BufferedLogger can be subclassed 2012-12-25 15:50:35 +01:00
Guillermo Iguaran
501175e3ad Merge pull request #8592 from rafaelfranca/warning_fix
Remove warning of intance variable not initialized
2012-12-24 20:29:52 -08:00
Zoltan Kiss
c651cc9d50 minor grammar fix 2012-12-24 15:20:05 -06:00
Xavier Noria
26c024e959 silences "possibly useless use of :: in void context" warnings
The AS utility silence_warnings does not really silence this
one, because it is issued at parse-time. It seemed to in
some places because the constant was the only expression in
the block and therefore it was its return value, that could
potentially be used by silence_warnings are return value of
the yield call.

To bypass the warning we assign to a variable. The chosen
variable is "_" because it is special-cased in parse.c not
to issue an "assigned but unused variable" warning in turn.
2012-12-24 21:16:16 +01:00
Rafael Mendonça França
7f7c09c1f3 Remove warning of intance variable not initialized 2012-12-23 20:32:09 -03:00
Jeremy Kemper
f9da785d0b Move background jobs to the 'jobs' branch until fully baked. Not shipping with Rails 4.0. 2012-12-21 16:29:47 -08:00
Steve Klabnik
10c0a3bd11 Merge pull request #8471 from kytrinyx/refactor-xml-to-hash
WIP Refactor xml conversion to hash
2012-12-21 15:54:13 -08:00
Steve Klabnik + Katrina Owen
b02ebe73cf Refactor Hash.from_xml.
Three basic refactors in this PR:

* We extracted the logic into a method object. We now don't define a tone of extraneous methods on Hash, even if they were private.
* Extracted blocks of the case statement into methods that do the work. This makes the logic more clear.
* Extracted complicated if clauses into their own query methods. They often have two or three terms, this makes it much easier to see what they _do_.

We took care not to refactor too much as to not break anything, and put comments where we suspect tests are missing.

We think ActiveSupport::XMLMini might be a good candidate to move to a plugin in the future.
2012-12-21 23:49:43 +00:00
Rafael Mendonça França
ecc7751575 Merge pull request #7376 from dmitriy-kiriyenko/fix-double-callback-in-same-statement
Prevent callback from being set twice.

Conflicts:
	activesupport/CHANGELOG.md
2012-12-21 17:39:03 -03:00
Rafael Mendonça França
48b40ec6fa BufferedLogger is deprecated too. 2012-12-21 15:59:13 -03:00
David Heinemeier Hansson
95f5f8167f Revert "Make sure that ActiveSupport::Logger includes the Logger extensions from core_ext/logger" (some confusion over deprecation)
This reverts commit d00f568a83a5159ed93618b1081bd17858536d1c.
2012-12-21 19:35:10 +01:00
David Heinemeier Hansson
d00f568a83 Make sure that ActiveSupport::Logger includes the Logger extensions from core_ext/logger 2012-12-21 19:28:24 +01:00
David Heinemeier Hansson
f914454f3a Add ActiveSupport::Logger#silence that works the same as the old Logger#silence extension 2012-12-21 19:15:36 +01:00
Vijay Dev
e0176bf732 Merge branch 'master' of github.com:lifo/docrails 2012-12-21 23:14:08 +05:30
Carlos Antonio da Silva
c7d7e7f751 Fix doc pointing to non existent logger class [ci skip] 2012-12-21 09:10:29 -02:00
Rafael Mendonça França
4eefa1ef1d Merge pull request #8560 from u16suzu/master
Fix document for String#humanize

Conflicts:
	activesupport/lib/active_support/core_ext/string/inflections.rb
2012-12-20 18:29:49 -03:00
Dmitriy Kiriyenko
4a9644a0d9 Prevent callback from being set twice.
When you add one callack in two separate `set_callback` calls - it is
only called once.

When you do it in one `set_callback` call - it is called twice.

This violates the principle of least astonishment for me. Duplicating
callback is usually an error. There is a correct and obvious way to do
anything without this "feature".

If you want to do

    before_save :clear_balance, :calculate_tax, :clear_balance

or whatever, you should better do

    before_save :carefully_calculate_tax

    def carefully_calculate_tax
      clear_balance
      calculate_tax
      clear_balance
    end

And this even opens gates for some advanced refactorings, unlike the
first approach.

My assumptions are:

- Principle of least astonishment is violated, when callbacks are either
  prevented from duplication, or not.
- Duplicating callbacks is usually an error. When it is intentional -
  it's a smell of a bad design and can be approached without abusing
  this "feature".

My suggestion is: do not allow duplicating callbacks in one callback
call, like it is not allowed in separate callbacks call.
2012-12-20 11:06:45 +02:00
John Kelly
9f42f732a4 Remove Reference to Ruby 1.8.7 2012-12-20 00:24:49 -08:00
Carlos Antonio da Silva
42b555dcf3 Fix Action Mailer changelog indenation to match other changelogs
Also some minor improvements to other changelogs. [ci skip]
2012-12-19 23:09:04 -02:00
Yuichiro Suzuki
f12d09f97f Fix: documentation for String#humanize 2012-12-20 01:20:05 +09:00
Max Shytikov
5c335420c8 attempt to fix slow runner name method 2012-12-19 16:32:01 +02:00
Francesco Rodriguez
9f4386c362 fix AS::BasicObject :nodoc: [ci skip] 2012-12-17 10:56:27 -05:00
Pablo Torres
d963ff433c Add missing requires to core_ext/integer/time 2012-12-16 20:27:10 -05:00
Pavel Pravosud
bb1d3c1f8e AS::BasicObject can be inherited from 2012-12-15 20:57:45 +07:00
Brett Carter
8f8397e0a4 Remove unicode character encoding from ActiveSupport::JSON.encode
The encoding scheme (e.g. ☠ -> "\u2620") was broken for characters
not in the Basic Multilingual Plane.  It is possible to escape them
for json using the weird encoding scheme of a twelve-character
sequence representing the UTF-16 surrogate pair (e.g. '𠜎' ->
"\u270e\u263a") but this wasn't properly handled in the escaping code.
Since raw UTF-8 is allowed in json, it was decided to simply pass
through the raw bytes rather than attempt to escape them.
2012-12-14 18:54:32 -05:00
Carlos Antonio da Silva
df9f9b7f3e Convert changelogs to 1.9 hash style and fix some formatting [ci skip] 2012-12-14 20:25:22 -02:00
Aaron Patterson
49219293e5 Merge pull request #8510 from thedarkone/thread_safety_improvements
Thread safety improvements
2012-12-14 11:12:50 -08:00
thedarkone
45448a5788 Replace some global Hash usages with the new thread safe cache.
Summary of the changes:
 * Add thread_safe gem.
 * Use thread safe cache for digestor caching.
 * Replace manual synchronization with ThreadSafe::Cache in Relation::Delegation.
 * Replace @attribute_method_matchers_cache Hash with ThreadSafe::Cache.
 * Use TS::Cache to avoid the synchronisation overhead on listener retrieval.
 * Replace synchronisation with TS::Cache usage.
 * Use a preallocated array for performance/memory reasons.
 * Update the controllers cache to the new AS::Dependencies::ClassCache API.
   The original @controllers cache no longer makes much sense after @tenderlove's
   changes in 7b6bfe84f3 and f345e2380c.
 * Use TS::Cache in the connection pool to avoid locking overhead.
 * Use TS::Cache in ConnectionHandler.
2012-12-14 12:18:47 +01:00
Rafael Mendonça França
a565f80bcb Backport thread-local variables from Ruby 2.0 2012-12-11 18:52:02 -03:00