Commit Graph

36018 Commits

Author SHA1 Message Date
Carlos Antonio da Silva
09d1fb25c3 Merge pull request #9042 from senny/9034_float_0_0_is_always_dirty
Assigning '0.0' to a nullable numeric column does not make it dirty

Example:
    product = Product.create price: 0.0
    product.price = '0.0'
    product.changed? # => false (this used to return true)
    product.changes # => {} (this used to return { price: [0.0, 0.0] })
2013-03-05 05:15:22 -08:00
Yves Senn
4b7a33e142 assigning '0.0' to a nullable numeric column does not make it dirty 2013-03-05 14:00:41 +01:00
Carlos Antonio da Silva
5cf472e043 Merge pull request #9561 from inossidabile/explicit_match_via_requirement_exception_message
Routing match `via` option requirement exception message made more explicit
2013-03-05 04:38:58 -08:00
Boris Staal
3ef641e095 Routing match via option requirement exception message made more explicit 2013-03-05 19:27:02 +07:00
Carlos Antonio da Silva
ee44469707 Merge pull request #9557 from bonsaiben/useless_gsub
Change useless gsub to delete
2013-03-05 03:38:46 -08:00
Carlos Antonio da Silva
57c516f775 Fix typo in AC overview guide [ci skip] 2013-03-05 08:31:44 -03:00
Xavier Noria
3f490caeef Merge pull request #9556 from senny/strong_params_examples
strong parameters example for default values using `fetch`.
2013-03-05 02:04:31 -08:00
Yves Senn
0e7abf21dd example for accepts_nested_attribtues_for and strong parameters.
Closes #9558.
2013-03-05 10:58:39 +01:00
Yves Senn
aeb48c3b29 strong parameters example for default values using fetch. [ci skip]
Origin: #9534.
2013-03-05 10:58:39 +01:00
Benjamin Sullivan
c6147113fa change useless gsub to delete 2013-03-05 17:32:37 +09:00
José Valim
40936da372 Merge pull request #9554 from tmm1/string-gsub-hash
Use 1.9 String#gsub syntax
2013-03-04 20:17:17 -08:00
Aman Gupta
cc986db546 Call String#gsub with Hash directly 2013-03-04 20:09:21 -08:00
Xavier Noria
5807513048 adds guides/.document to tell rdoc not to process this directory
When the Rails 4 gem is installed rdoc sees markdown files below the
guides directory and processes them. With an empty .document file
we prevent that from happening. Thanks to @drbrain for the tip.
2013-03-04 22:28:23 +01:00
Rafael Mendonça França
c5be90e8c4 Merge pull request #9467 from senny/9459_include_json_root_out_of_sync
`ActiveRecord::Base.include_root_in_json` is `false` by default.
2013-03-04 12:26:50 -08:00
Yves Senn
8c7d4018e0 ActiveRecord::Base.include_root_in_json is false by default.
Closes #9459.

The PR #6597 unified the configuration for `include_root_in_json`
in AM and AR to `false`.
Later on with the refactoring commit: e030f26 the value in AR was
set to `true` but I think this was not on purpose.

With this commit both AM and AR will have the same configuration
for `include_root_in_json`, which is `false`.
2013-03-04 21:18:40 +01:00
Yves Senn
eeba679470 rewrite tests to have no side-effects on include_root_in_json. 2013-03-04 21:18:40 +01:00
Aaron Patterson
54f9b7584d only calculate next_id when we need a new method defined 2013-03-04 10:52:07 -08:00
José Valim
b359c5db9f Merge pull request #9541 from maximerety/fix_7774
Fix formats on xhr requests when HTTP_ACCEPT is empty string
2013-03-04 07:26:17 -08:00
Xavier Noria
9025f49570 Merge pull request #9540 from dimko/patch-1
Fixed typo in active record's changelog
2013-03-04 07:00:11 -08:00
Dimko
71e4dfc9f4 Fixed typo in active record's changelog 2013-03-04 18:56:46 +04:00
maximerety
1d217abc3d Fix formats on xhr requests when HTTP_ACCEPT is empty string
Fix ActionDispatch::Request#formats on xhr requests when HTTP_ACCEPT
header is empty string. About issue #7774, same fix as in commit bebb02f
but for xhr requests.
2013-03-04 14:43:31 +00:00
Carlos Antonio da Silva
2e28045b48 Remove .all usage from unscope doc examples [ci skip] 2013-03-04 09:06:34 -03:00
Carlos Antonio da Silva
96050e1d73 Use 1.9 hash style in changelog and doc examples [ci skip] 2013-03-04 09:04:48 -03:00
Steve Klabnik
8d69cd3e68 Merge pull request #9537 from NARKOZ/patch-6
add prompt to 422 page to check logs
2013-03-04 03:22:53 -08:00
Nihad Abbasov
f9be80f51c add prompt to 422 page to check logs 2013-03-04 13:06:06 +04:00
Jeremy Kemper
1909808171 Merge pull request #9200 from wangjohn/unscoping_activerecord_merging
Introduce relation #unscope
2013-03-03 19:47:48 -08:00
Carlos Antonio da Silva
d3fa025969 Merge pull request #9532 from neerajdotname/fix-sql-in-example
In example fix sql that is generated from scoping
2013-03-03 17:47:57 -08:00
wangjohn
293875457b Created an unscope method for removing relations from a chain of
relations. Specific where values can be unscoped, and the unscope method
still works when relations are merged or combined.
2013-03-03 20:42:01 -05:00
José Valim
9ee6f3cc8e Bring config.allow_concurrency back
Since the Rack::Lock still exists in development,
let's provide a way to disable it explicitly.
2013-03-03 13:20:44 -07:00
Andrew White
86cf7a2d16 Use custom visitor class for optimized url helpers
Rather than trying to use gsub to remove the optional route segments,
which will fail with nested optional segments, use a custom visitor
class that returns a empty string for group nodes.

Closes #9524
2013-03-03 19:18:01 +00:00
Neeraj Singh
11731385d4 fix the sql that is generated from scoping 2013-03-03 11:55:20 -05:00
Xavier Noria
48c21e3255 Merge pull request #9465 from senny/document_strong_params_in_ac_guide
integrate the strong params README into the AC guide.
2013-03-03 04:49:58 -08:00
Yves Senn
fb63753031 integrate the strong params README into the AC guide.
The current ActionController guide does not mention strong parameters
at all. I integrated the README into the guide to explain the API.

I also included a section to illustrate that the API does not solve
all possible whitelisting scenarios.

The origin was #9454.
2013-03-03 13:19:08 +01:00
Guillermo Iguaran
8fe904b5ca Merge pull request #9512 from Jacke/master
New 404, 422, 500 pages, they are more stylish and bring ruby essence…
2013-03-02 14:06:37 -08:00
José Valim
dd5a80dc3d Remove hard coded references to Active Record in railties 2013-03-02 13:52:32 -07:00
Andrew White
c09f934dcb Merge pull request #9431 from troyk/patch-2
Fix PostgreSQL TIMESTAMP WITH TIME ZONE to return ActiveSupport::Time
2013-03-02 10:03:04 +00:00
Akira Matsuda
2d4068dbef ✂️ extra blank line 2013-03-02 11:16:50 +09:00
Rafael Mendonça França
35050ab26d Merge pull request #9510 from senny/7364_warn_when_appending_prepending_to_an_association
deal with `#append` and `#prepend` on association collections
2013-03-01 12:31:43 -08:00
Yves Senn
b9399c470b deal with #append and #prepend on association collections.
Closes #7364.

Collection associations behave similar to Arrays. However there is no
way to prepend records. And to append one should use `<<`. Before this
patch `#append` and `#prepend` did not add the record to the loaded
association.

`#append` now behaves like `<<` and `#prepend` is not defined.
2013-03-01 21:29:46 +01:00
Jeremy Kemper
99775fd161 Restore note about nested SCRIPT_NAME handling. 2013-03-01 11:47:04 -07:00
Stanislav
40f1642b67 New beauty pages(404, 422, 500)
moving changelog note to unreleased section

New beauty pages(404, 422, 500)
2013-03-02 00:24:54 +06:00
Troy Kruthoff
2cc09441c2 Fix PostgreSQL TIMESTAMP WITH TIME ZONE to return ActiveSupport::Time
In an AR model a timestamptz attribute would return a ruby string and AR
tests did not check for any type casting.  Previous tests would pass
only because an assert_equal was being used on a Time.utc object, which
will parse the right side of the eq to a valid Time instance for
comparision.

switch to test instance of Time instead of ActiveSupport::TimeWithZone
2013-03-01 09:51:23 -08:00
Yves Senn
ce7133bf52 don't use non-ascii ' chars in documentation 2013-03-01 15:18:29 +01:00
Carlos Antonio da Silva
b49a2a779b Merge pull request #8652 from codeodor/create_table_migration
Support creating a table migration generator

Sometimes you want to create a table without an associated model and
test, which is also not a join table. With this commit, you can now
do that.

Example:

    rails g migration create_posts title:string
or
    rails g migration CreatePosts title:string

This commit also moves the template the model generator uses for the
migration to the migration templates folder, as it seems a more
sensible place for it now that it is shared code.
2013-03-01 04:23:21 -08:00
Sammy Larbi
20e041579f Support creating a table migration generator
Sometimes you want to create a table without an associated model and
test, which is also not a join table. With this commit, you can now
do that.

Example:

    rails g migration create_posts title:string
or
    rails g migration CreatePosts title:string

This commit also moves the template the model generator uses for the
migration to the migration templates folder, as it seems a more
sensible place for it now that it is shared code.
2013-03-01 06:13:30 -06:00
Jeremy Kemper
bb9f8312e7 Wordsmithing @trevorturk's upgrade notes
Removed the bit about `SCRIPT_NAME` handling, since setting
`default_url_options[:script_name]` does work correctly.
We ran into an issue with it but it was an app bug.
2013-02-28 21:22:34 -07:00
Jeremy Kemper
1823c2daef Merge pull request #9495 from trevorturk/upgrade-guide
Add some more documentation to the upgrade guide
2013-02-28 14:01:32 -08:00
Trevor Turk
7874c9be83 Document introduction of ActionDispatch::ParamsParser::ParseError 2013-02-28 15:55:27 -06:00
Trevor Turk
5b8b9771d7 Document that scopes require a callable object 2013-02-28 15:53:24 -06:00
Trevor Turk
51876271e2 Document common deprecations 2013-02-28 15:50:28 -06:00