Commit Graph

42114 Commits

Author SHA1 Message Date
Francis Go
9690bcf503 Ruby on Rails 4.1 Release Notes: Fix spelling [ci skip] 2014-01-27 17:10:21 +11:00
Washington Luiz
8b14b11434 Display value when raising due to unscope() issues
Hopefully make it easier to debug errors. e.g

Before:

    RuntimeError:
       unscope(where: "deleted_at") failed: unscoping String is unimplemented.

After:

    RuntimeError:
       unscope(where: "deleted_at") failed: unscoping String "'t'='t'" is unimplemented.
2014-01-27 02:18:56 -03:00
Andrew White
dd339bb0ad Make ActiveSupport::TimeWithZone#xmlschema consistent
Both Time#xmlschema and DateTime#xmlschema can accept nil values for the
fraction_digits parameter. This commit makes this so for TimeWithZone
values as well.
2014-01-26 21:25:54 +00:00
Andrew White
c096500448 Add support for JSON time_precision to Time and DateTime 2014-01-26 21:25:54 +00:00
Andrew White
9484f4b821 Add CHANGELOG entry for #11464 2014-01-26 21:25:54 +00:00
Andrew White
e3c382e3d6 Rename subsecond_fraction_digits option to time_precision 2014-01-26 21:25:54 +00:00
Andrew White
ef17225173 Consolidate JSON encoding tests in one file 2014-01-26 21:25:54 +00:00
Parker Selbert
4cfc467594 Customize subsecond digits when encoding DateWithTime
The subsecond fraction digits had been hardcoded to 3. This forced all
timestamps to include the subsecond digits with no way to customize the
value. While the subsecond format is part of the ISO8601 spec, it is not
adhered to by all parsers (notably mobile clients). This adds the
ability to customize the number of digits used, optionally setting them
to 0 in order to eliminate the subsecond fraction entirely:

ActiveSupport::JSON::Encoding.subsecond_fraction_digits = 0
2014-01-26 21:25:54 +00:00
Xavier Noria
e1e17a55d2 adds a section about booleans in the API guidelines [ci skip] 2014-01-26 22:10:05 +01:00
Xavier Noria
225bcadfed API guidelines: revises warning about +...+ [ci skip]
Modern RDoc accepts a few more things in +...+. In particular symbols work now.

The current regexp in RDoc is https://github.com/rdoc/rdoc/blob/v4.1.1/lib/rdoc/markup/attribute_manager.rb#L133.
2014-01-26 21:36:17 +01:00
Xavier Noria
0df1f91410 revises references to :allow_(nil|blank) in some docs [ci skip] [Steven Yang & Xavier Noria]
Closes #11247.
2014-01-26 20:50:18 +01:00
Robin Dupret
61554efd02 Merge pull request #13846 from gsaks123/patch-1
Fix order syntax in find_by_sql example [ci skip]
2014-01-26 11:23:50 -08:00
Greg Saks
70588be101 Fix order syntax in find_by_sql example 2014-01-26 14:21:05 -05:00
Andrew White
b594492870 Maintain current timezone when changing time during DST overlap
Currently if a time is changed during DST overlap in the autumn then the
method `period_for_local` will return the DST period. However if the
original time is not DST then this can be surprising and is not what is
generally wanted. This commit changes that behavior to maintain the current
period if it's in the list of periods returned by `periods_for_local`.

It is possible to alter the behavior of `period_for_local` by specifying a
second argument but since we may be change from another time that could be
either DST or not then this would give inconsistent results.

Fixes #12163.
2014-01-26 16:56:33 +00:00
Robin Dupret
718d3b0bc5 Remove an extra comment [ci skip] 2014-01-26 13:11:26 +01:00
Andrew White
4df9cc29c1 Support underscored symbols in Action Mailer config
We allow the use of underscored symbols to represent classes throughout
other parts of Rails so it seems incongruous that it's not supported in
`register_interceptor` and `register_observer`.
2014-01-26 12:05:35 +00:00
Andrew White
7d86352f83 Don't use a class_attribute for ActionMailer::Base.preview_path
Since preview_path is read from ActionMailer::Base when previewing, subclasses
can’t change it so don’t there's no need for the extra overhead imposed by using it.
2014-01-26 12:05:35 +00:00
Andrew White
35fd81672e Add the ability to intercept emails before previewing
To support the ability for tools like CSS style inliners to operate on emails
being previewed this commit adds a hook in a similar fashion to the existing
delivery interceptor hook, e.g:

  class CSSInlineStyler
    def self.previewing_email(message)
      # inline CSS styles
    end
  end

  ActionMailer::Base.register_preview_interceptor CSSInlineStyler

Fixes #13622.
2014-01-26 12:05:35 +00:00
Godfrey Chan
14d59d2a25 Merge pull request #13844 from Alamoz/config_grammar
thread -> threaded [ci skip]
2014-01-25 23:57:53 -08:00
Adrien Lamothe
9d0fceb55d Correct grammar from '... allowing both thread web servers ...' to '... allowing both threaded web servers ...'. 2014-01-25 23:04:36 -08:00
Guillermo Iguaran
81c1f5875e Merge pull request #13841 from robin850/patch-15
Add a missing changelog entry for #13825 [ci skip]
2014-01-25 13:47:43 -08:00
Robin Dupret
fe63933cee Add a missing changelog entry for #13825 [ci skip] 2014-01-25 22:12:28 +01:00
Prathamesh Sonpatki
08bbe5dc2e Replace Post with Article in getting started guide [ci skip]
- Used Article model instead of Post as it may confuse with 'post'
  requests
- Tried to wrap the guide to 80 chars lines as much as possible.
- Removed unused image
- Fixes #13764
2014-01-25 22:34:31 +05:30
Andrew White
a31a44a266 Add additional tests for #13824 2014-01-25 07:38:29 +00:00
Byron Bischoff
345555cd4c Transform dashes to underscores in resource route names
Fixes #13824
2014-01-25 07:19:33 +00:00
Godfrey Chan
94ce51445e Merge pull request #13772 from chancancode/fix_has_secure_password_for_good
Refactored validations rules for has_secure_password
2014-01-24 20:35:48 -08:00
Guillermo Iguaran
7776fd6afb Merge pull request #13835 from frodsan/remove_unused_argument
Remove unused argument.
2014-01-24 20:35:00 -08:00
Godfrey Chan
98705d88cd Some minor fixes 2014-01-24 20:06:31 -08:00
Godfrey Chan
b6ddbfb158 Removed old tests 2014-01-24 19:49:31 -08:00
Godfrey Chan
8ca59237dd Got all the new tests passing 2014-01-24 19:49:30 -08:00
Godfrey Chan
20490adcbf Restored the ability to clear the password with user.password= nil (see the docs) 2014-01-24 19:49:30 -08:00
Godfrey Chan
19a4ef305d Rewrote the tests for has_secure_password 2014-01-24 19:49:30 -08:00
Francesco Rodriguez
e2f3e0dc50 Remove unused argument. 2014-01-24 22:25:15 -03:00
Yves Senn
220ee0c74a Merge pull request #13785 from kuldeepaggarwal/fix-find_with_multiple_ids
Fix `ActiveRecord::RecordNotFound` error message with custom primary key
2014-01-24 15:13:16 -08:00
Kuldeep Aggarwal
3a0ddf3394 Fix ActiveRecord::RecordNotFound error message with custom primary key 2014-01-25 02:29:23 +05:30
Rafael Mendonça França
c438c61794 Merge pull request #13829 from qsymmachus/improve_validates_with_example
Reordered classes in AR Validation #validates_with example [ci skip]
2014-01-24 11:41:25 -08:00
John Olmsted & Strand McCutchen
098a960266 Reordered classes in AR Validation #validates_with example [ci skip]
Person called GoodnessValidator before it was defined.
This change will compile the example correctly.
2014-01-24 11:30:07 -08:00
Guillermo Iguaran
0a43bf3146 Add a test-case for GH #13825 2014-01-24 14:10:46 -05:00
Guillermo Iguaran
f5c3531ade Merge pull request #13828 from bronzle/apploader-should-check-for-file
app_rails_loader.rb should check if bin/rails is a File before calling F...
2014-01-24 10:05:35 -08:00
Byron Bischoff
cf6c00d027 app_rails_loader.rb should check if bin/rails is a File before calling File.read(exe); closes #13825 2014-01-24 10:00:31 -08:00
Yves Senn
8efd5fec75 Merge pull request #13811 from mdesantis/issue-13810
Fixes #13810 `rake routes` error when mount `Rails::Engine` with empty routes
2014-01-24 04:34:22 -08:00
Maurizio De Santis
c1f8a0d614 Fix rake routes error when Rails::Engine with empty routes is mounted; fixes rails/rails#13810
Squash
2014-01-24 12:41:48 +01:00
Yves Senn
e61b841a4f Merge pull request #13821 from vipulnsward/remove-assignment-in-test
Remove unused assignment to fix warnings in enum test.
2014-01-23 23:52:25 -08:00
Vipul A M
9b254df181 Remove unused assignment to fix warnings in enum test. 2014-01-24 12:14:02 +05:30
Guillermo Iguaran
f1a0b15139 Merge pull request #13819 from arthurnn/one_require_test
unify param.require tests
2014-01-23 19:33:59 -08:00
Arthur Neves
aae53d2175 unify param.require tests 2014-01-23 22:28:24 -05:00
Guillermo Iguaran
bc0820c495 Merge pull request #13818 from arthurnn/small_test_case
test boolean and number json param parsing
2014-01-23 19:03:24 -08:00
Arthur Neves
96dd3016d1 test boolean and number json param parsing 2014-01-23 21:56:28 -05:00
Godfrey Chan
a7680ab47d Merge pull request #13795 from bobbus/errors-has-key
Fix ActiveModel::Errors#has_key? returning nil
2014-01-23 08:30:04 -08:00
Jeremy Kemper
6ef0569b0b Merge pull request #13799 from kbrock/better_dirty
Better ActiveRecord hierarchy for Dirty and others
2014-01-22 13:44:11 -08:00