Commit Graph

35988 Commits

Author SHA1 Message Date
Aaron Weiner
53f18f2c54 More helpful error message when instantiating an abstract class
Calling a literal ActiveRecord::Base.new raises NoMethodError,
since it ends up calling Class.abstract_class? which does not exist.
Similarly, instantiating an actual abstract class hits the database,
when conventionally it should immediately throw NotImplementedError.

ActiveRecord::Base can't be made abstract without breaking many,
many things, so check for it separately.
2013-03-03 12:36:51 -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
Trevor Turk
0407ef5eaf Document the deprecation of ActionView::RecordIdentifier 2013-02-28 15:45:37 -06:00
Trevor Turk
a1d8b031d3 Document ActiveRecord::Fixtures becoming ActiveRecord::FixtureSet 2013-02-28 15:41:20 -06:00
Trevor Turk
74d471a4aa Document change in routes using match 2013-02-28 15:40:25 -06:00
Rafael Mendonça França
2c3362829f Improve the CHANGELOG entry
[ci skip]
2013-02-28 18:35:07 -03:00
Trevor Turk
97d9843ef5 Document removal of assets:precompile:primary 2013-02-28 15:34:38 -06:00
Rafael Mendonça França
12cbc57aad Merge pull request #9493 from kennyj/fix_wrong_exception
Wrong exception is occured when raising no translatable exception

Closes #8617
2013-02-28 13:32:36 -08:00
Rafael Mendonça França
c4f2f5b9d7 Improve the CHANGELOG entry
[ci skip]
2013-02-28 18:31:46 -03:00
Trevor Turk
cfb04a69a1 Document sass-rails asset_url deprecation 2013-02-28 15:29:05 -06:00
Rafael Mendonça França
fae2e4d05d Merge pull request #9366 from killthekitten/fix-content_for-regression
Fix for #9360 content_for regression
2013-02-28 13:28:50 -08:00
Trevor Turk
8ecc2edcd0 Document caveat from 5b3bb61 which fixed handling SCRIPT_NAME from within mounted engine 2013-02-28 15:19:54 -06:00
Trevor Turk
1525268d1e Document rails-observers extraction 2013-02-28 14:25:07 -06:00
Trevor Turk
3dd5444e56 Document the switch from memcache-client to dalli 2013-02-28 14:17:47 -06:00
Trevor Turk
decff78d01 Improve docs for UpgradeSignatureToEncryptionCookieStore 2013-02-28 14:16:36 -06:00
Trevor Turk
27a304d8e0 Document extraction of actionpack-xml_parser 2013-02-28 14:06:15 -06:00
Trevor Turk
43ab0158fb Document introduction of the ActionController::UnknownFormat exception 2013-02-28 14:02:56 -06:00
José Valim
dc53fe9240 Ensure plugins generated with plugin new can boot the dummy application 2013-02-28 12:09:04 -07:00
kennyj
e2a4b7a506 Wrong exception is occured when raising no translatable exception 2013-03-01 02:47:57 +09:00
Carlos Antonio da Silva
8f6b70f1fd Merge pull request #9484 from senny/9480_change_table_and_hstore
Support PostgreSQL specific column types when using `change_table`.

We use `TableDefinition` for `#create_table` and `Table` for `#change_table`.
The PostgreSQL sepcific types were only defined on `TableDefinition` so they needed to be added to `Table` as well.
2013-02-28 04:49:47 -08:00
Yves Senn
5d0ca74622 Support PostgreSQL specific column types when using change_table.
Closes #9480.

We use `TableDefinition` for `#create_table` and `Table` for `#change_table`.
The PostgreSQL sepcifc types were only defined on `TableDefinition` so I
also added them to `Table`.
2013-02-28 13:42:30 +01:00
Carlos Antonio da Silva
a3894380eb Minor changelog improvement [ci skip] 2013-02-28 08:41:53 -03:00
Yves Senn
36abb550e7 update docs, change_table does not use TableDefinition. 2013-02-28 08:59:07 +01:00
Andrew White
cf278a6eff Remove redundant method 2013-02-28 03:37:52 +00:00
Andrew White
17cff2c1b8 Merge pull request #9469 from senny/9466_format_enforcing_routes
`format: true` does not override existing format constraints.
2013-02-27 19:17:31 -08:00
Carlos Antonio da Silva
9126d53a07 Enforce i18n version >= v0.6.4
Keep in sync with 3-2-stable.
2013-02-27 21:08:27 -03:00
Yves Senn
afddc0409e format: true does not override existing format constraints.
Closes #9466.

Passing `format: true` used to override the constraints: { format: /json/ }
with `/.+/`. This patch only sets the format if there is no constraint present.
2013-02-27 19:57:41 +01:00
Steve Klabnik
afd4a14332 Revert "Merge pull request #9207 from dylanahsmith/mysql-quote-numeric"
This reverts commit 408227d9c5ed7de26310d72a1a99c1ee02311c63, reversing
changes made to dca0b57d03deffc933763482e615c3cf0b9a1d97.
2013-02-27 08:46:40 -08:00
José Valim
5c1354901e Improve docs for AbsC::Rendering 2013-02-27 08:30:46 -07:00
Santiago Pastorino
45aabe6152 There's no need to access Railties through self.class
Closes #9386
2013-02-27 13:11:45 -02:00
Carlos Antonio da Silva
02037c3ea0 Merge pull request #9218 from Fivell/master
Fix calculation of db_runtime property in
ActiveRecord::Railties::ControllerRuntime#cleanup_view_runtime.

Previously, after raising ActionView::MissingTemplate, db_runtime was
not populated.

Closes #9218, Fixes #9215.

Conflicts:
	activerecord/CHANGELOG.md
2013-02-27 11:47:24 -03:00
Igor
dd0bbd2ccb fix db_runtime attribute value after raising ActionView::MissingTemplate exception 2013-02-27 16:35:22 +02:00