Commit Graph

2008 Commits

Author SHA1 Message Date
Xavier Noria
17c29a0df0 Merge remote-tracking branch 'docrails/master'
Conflicts:
	activesupport/lib/active_support/core_ext/hash/deep_merge.rb
	activesupport/lib/active_support/core_ext/hash/keys.rb
2013-11-24 20:00:24 +01:00
Xavier Noria
28a6a7ea3b a couple of copy-edits before merging [ci skip] 2013-11-24 19:55:46 +01:00
Martin Harrigan
08c72946c5 Helper should be a module in Rails guides [ci skip] 2013-11-23 11:26:17 +00:00
Harshad Sabne
eb67aa976b API Documentation Guidelines link correction [ci skip] 2013-11-23 10:45:07 +05:30
Jacob Evan Shreve
c796cc2ba7 Added a missing close parenthesis to i18n.md 2013-11-21 22:18:17 -05:00
Jon Leighton
64b9e93bb5 Fix ActiveRecord::Relation#unscope
I'm pretty confused about the addition of this method. The documentation
says that it was intended to allow the removal of values from the
default scope (in contrast to #except). However it behaves exactly the
same as except: https://gist.github.com/jonleighton/7537008 (other than
having a slightly enhanced syntax).

The removal of the default scope is allowed by
94924dc32baf78f13e289172534c2e71c9c8cade, which was not a change we
could make until 4.1 due to the need to deprecate things. However after
that change #unscope still gives us nothing that #except doesn't already
give us.

However there *is* a desire to be able to unscope stuff in a way that
persists across merges, which would allow associations to be defined
which unscope stuff from the default scope of the associated model. E.g.

  has_many :comments, -> { unscope where: :trashed }

So that's what this change implements. I've also corrected the
documentation. I removed the guide references to #except as I think
unscope really supercedes #except now.

While we're here, there's also a potential desire to be able to write
this:

  has_many :comments, -> { unscoped }

However, it doesn't make sense and would not be straightforward to
implement. While with #unscope we're specifying exactly what we want to
be removed from the relation, with "unscoped" we're just saying that we
want it to not have some things which were added earlier on by the
default scope. However in the case of an association, we surely don't
want *all* conditions to be removed, otherwise the above would just
become "SELECT * FROM comments" with no foreign key constraint.

To make the above work, we'd have to somehow tag the relation values
which get added when evaluating the default scope in order to
differentiate them from other relation values. Which is way too much
complexity and therefore not worth it when most use cases can be
satisfied with unscope.

Closes #10643, #11061.
2013-11-20 22:23:16 +00:00
Jonathan Baudanza
99eb1eb4df Update caching guide with respect to :namespace
Cache::Store does not have a default value for :namespace. If it ever did, I can't find it in the git history.
2013-11-19 17:06:50 -08:00
Carlos Antonio da Silva
20d3484f32 Improve reading / style of hashes in AR guide 2013-11-19 10:54:46 -02:00
Carlos Antonio da Silva
db3ec51832 Revert last two commits mistakenly changing join/include syntax
---

Revert "syntax error joining/including models"

This reverts commit ac35f72f30c47298a20a90c8c537db888b463bbb.

---

Revert "syntax error joining tables"

This reverts commit c365986b48c3e8bc8c7f3fa6a8521616ed5dc138.

---

Comments:

c365986b48 (commitcomment-4630684)
2013-11-19 10:46:55 -02:00
Ben Lewis
5019a046c6 Fixed typos in shallow routes and routing concerns
Grammatical tense correction: "There exists two" => "There exist two".
Plurality correction: "can be reused inside others resources" => "can be reused inside other resources".
2013-11-18 21:10:21 -07:00
Sergio
ac35f72f30 syntax error joining/including models
syntax error joining/including models
2013-11-18 18:39:06 +01:00
Sergio
c365986b48 syntax error joining tables
syntax error joining tables
2013-11-18 18:31:37 +01:00
Paul Nikitochkin
251923c7a8 Instrument each load config initializer
In order to simplify profiling loading of initializers,
added instument for tracking load config initializer event from
`config/initializers`
2013-11-16 21:47:08 +02:00
Peter Vandenabeele
76d4dd6e05 [ci skip] typo in ArgumentError exception 2013-11-16 15:33:14 +01:00
Rafael Mendonça França
38b312a86f Merge pull request #12907 from JuanitoFatas/upgrading
[ci skip] Update gem versions for 3.2 and 3.1. Also change some words.
2013-11-15 18:55:50 -08:00
Juanito Fatas
66e44862bd [ci skip] Update gem versions for 3.2 and 3.1. Also change some words. 2013-11-16 10:24:18 +08:00
Sıtkı Bağdat
324ac5f20b Change Relation#all to Relation#load [ci skip] 2013-11-15 23:31:23 +02:00
Harshad Sabne
4a98938ff4 Update action_controller_overview.md [ci skip]
Code style adherence
2013-11-15 22:32:44 +05:30
Rafael Mendonça França
72551c29f2 Merge pull request #10848 from 907th/add_block_to_cattr_reader
Fix #10847: allow to pass a block to `cattr_reader`.
2013-11-15 07:13:43 -08:00
Nate Berkopec
7910d7d863 Remove broken Commmand Line guide link
[ci skip]
2013-11-15 09:33:49 -05:00
Alexey Chernenkov
0e953c94b1 Unify cattr_* interface: allow to pass a block to cattr_reader.
Example:

    class A
      cattr_reader(:defr) { 'default_reader_value' }
    end
    A.defr # => 'default_reader_value'
2013-11-15 19:54:51 +06:00
Godfrey Chan
b090122e8b Make it clear that require 'active_support' is required [ci-skip] 2013-11-13 13:39:34 -08:00
Harshad Sabne
deeeaef6d2 Fix broken Wikipedia link. 2013-11-13 20:48:40 +05:30
Alex Johnson
ea5d3544d2 Remove outdated guide on using rack builder w/o rails middleware
[ci skip]
2013-11-13 13:35:10 +05:30
Yves Senn
49245f37f7 Revert "remove_column does not take a type argument. [ci skip]. Closes #12864"
As of Rails 4.0 `remove_column` is no longer an alias for `remove_columns`.
The type is actually valid and used when issuing a rollback (new `change` method).

This reverts commit 9c9d4948e428a226a19aa92c17fa6ac5833c2fb8.
2013-11-13 09:02:11 +01:00
Alex Johnson
006f710361 Correct guide relating MiddlewareStackProxy with Enumerable
[ci skip] Enumerable.instance_methods &
Rails::Configuration::MiddlewareStackProxy.instance_methods # =>
[:as_json]

MiddlewareStackProxy does not share any notable methods with Enumerable.
2013-11-13 13:30:58 +05:30
Juanito Fatas
825e350faa [ci skip] Fix curl response output and use strong parameters in update action. 2013-11-13 02:33:04 +08:00
Yves Senn
9c9d4948e4 remove_column does not take a type argument. [ci skip]. Closes #12864 2013-11-12 15:56:52 +01:00
Alex Johnson
b9a4560d91 [ci skip] Replace #=> with # => 2013-11-12 19:23:50 +05:30
Alex Johnson
5735a77def Fix RailsServer#start content in initialization guide
[ci skip]
2013-11-12 19:14:13 +05:30
Yves Senn
bd004eccfa Merge pull request #12851 from RKushnir/master
Include URL helpers in TestController in bug report templates [ci skip]
2013-11-11 12:17:03 -08:00
Roman Kushnir
299fe844dd Include URL helpers in TestController in bug report templates
[ci skip]

Fixes #12848.
2013-11-11 21:28:26 +02:00
Xavier Noria
b31b6e6699 Merge pull request #12815 from Adam89/patch-1
Update security.md [ci skip]
2013-11-11 07:33:38 -08:00
Jimmy Petersen
f387aa1bdd Fixed typo in migrations guide
Product model name was pluralized in example in migrations guide.
[ci skip]
2013-11-11 13:35:57 +01:00
Dmitry Korotkov
bc010e7140 Fix missing line and shadow on static error pages [ci skip] 2013-11-11 11:17:44 +04:00
Jens Dahl Møllerhøj
18010385fd Fixed minor typo
instead of 'rake test' as shortcut, use 'rake'.

Closes #12780 [ci skip]
2013-11-09 18:49:50 -02:00
Adam
336caf9114 Update security.md
Hi Guys 
I was reading through this guide last night and noticed a small mistake, would be great if you could update it. 
I changed the word 'building' to 'build' in line 20. 
"Web application frameworks are made to help developers building web applications"
2013-11-08 13:43:31 -07:00
Gaurish Sharma
2476f9fcd3 ✂️ fix broken url [ci skip] 2013-11-09 00:01:50 +05:30
Xavier Noria
3d5e83fea4 removes redundant curly brackets in example code [ci skip] 2013-11-08 16:55:15 +01:00
Xavier Noria
f0963a61ad Merge pull request #12609 from corwinkelly/patch-1
Update workaround for "Outside the Scope of Strong Parameters"
2013-11-08 07:49:31 -08:00
Alex Johnson
83271a64f9 Add section for command_tasks in initialization guide
[ci skip]
2013-11-08 15:14:01 +05:30
Alex Johnson
3d449dee5e Update commands.rb content in initialization guide
[ci skip]
2013-11-08 15:07:39 +05:30
Vijay Dev
216ec8d559 Merge branch 'master' of github.com:rails/docrails 2013-11-07 23:32:47 +05:30
claudiob
c61544c781 Add +capitalize+ option to Inflector.humanize
So strings can be humanized without being capitalized:

    'employee_salary'.humanize                    # => "Employee salary"
    'employee_salary'.humanize(capitalize: false) # => "employee salary"
2013-11-06 13:03:46 -08:00
Alex Johnson
cb632188b3 Update Rails initialization guide to explain how bin/rails is executed 2013-11-06 18:24:22 +05:30
Derek Prior
0e41b0a87a Clarify HTML Safe Translations [ci-skip]
I think it's confusing to say "Use them in views without escaping." We
use all keys in views without escaping - the escaping is done for us
automatically _unless_ we call html_safe or the key ends in _html.
2013-11-05 11:16:04 -05:00
Rashmi Yadav
aa330d0d7a Fixed code syntax for config.ru [ci skip] 2013-11-04 21:55:07 +01:00
Yves Senn
9c4261351c document BACKTRACE env var usage in testing guide. [ci skip] 2013-11-04 17:43:05 +01:00
Carlos Antonio da Silva
e474e47bfa Update guides welcome page to point to version 3.2.15 [ci skip] 2013-11-02 17:31:22 -02:00
laurocaetano
d48222d22e remove warnings on ruby trunk 2013-11-01 18:15:53 -02:00
Rashmi Yadav
49062c12ed exists? is deprecated in ruby trunk [ci skip]
see here 4d4ff531b8807ee88a3fc46875c7e76f613956fb
2013-11-01 18:07:27 +01:00
Rafael Mendonça França
bdd518343e Merge pull request #12704 from JuanitoFatas/routing
[ci skip] Add actions to shallow table, change a tense in sentence, add
2013-10-31 07:53:01 -07:00
Xavier Noria
cc2a9df970 AS guide: errata 2013-10-31 12:35:08 +01:00
Juanito Fatas
5059769a35 [ci skip] Make all tables have Controller#Action, change a tense in sentence. 2013-10-31 18:45:09 +08:00
Rob Zolkos
2527ce70c5 show javascripts can be disabled in generators 2013-10-31 14:03:57 +11:00
Jeremy Kemper
dae66a0c97 Merge pull request #12203 from chancancode/eager_load_json
Eagerload active_support/json/encoding in active_support/core_ext/object/to_json
2013-10-30 10:43:43 -07:00
Alex Johnson
178c4f74f9 Update pull request instructions as per the new Github UI
[ci skip]
2013-10-30 13:25:28 +05:30
Xavier Noria
7edaecc475 Revert "add active model basics wip to guides/documents.yaml"
Reason: WIP guides are not in the index because they are partial
work pushed to the repo. Either there is someone working on them
or else the work was interrupted.

Guides are added to the index page when they are finished, the
author considers the draft to be complete, someone reviews them,
and overall they are considered to be good for users to read.

This reverts commit eefc03a8069bddfe31751c4bd4fb1804e7f33c2c.
2013-10-29 09:31:53 +01:00
Zachary Scott
97ad84e10d guides/rails_on_rack: Fix formatting of _Internal Middleware Stack_ section 2013-10-28 13:56:36 -04:00
Yves Senn
f85c4c6912 Merge pull request #11564 from zzak/active_model_guide
[Guides] Active Model Basics [ci skip]
2013-10-28 09:39:37 -07:00
Rafael Mendonça França
6fb056e3b6 Merge pull request #12578 from jeradphelps/configurable_schema_migrations_table_name
Configurable name for schema_migrations table

Conflicts:
	activerecord/CHANGELOG.md
2013-10-27 21:07:03 -02:00
Jerad Phelps
26638f0ac9 added schema_migrations_table_name to ActiveRecord::Base in order that the name of the schema migrations table can be configured.
consolidated test_schema_migrations_table_name tests

Added changelog entry

edited changelog

removed commented lines

removed reader

ensure the schema migrations table is reset at end of test

added entry to configuration guide

guides typo and changelog order
2013-10-27 08:50:35 -05:00
Damien Mathieu
a0fe2f1fc8 fix typo introduced when searching in markdown document with vim 2013-10-24 13:33:13 +02:00
Damien Mathieu
b8a538625a rephrase the overriding views part about the view path
See rails/rails#12608
2013-10-24 13:30:04 +02:00
Harshad Sabne
a31bb063bc Fixed URL link to rendered_component plugin [ci skip] 2013-10-23 22:32:29 +05:30
Evgeniy
eaed8220c2 [ci skip] second parameter of asset-url is depricated 2013-10-23 20:42:30 +04:00
corwinkelly
872b3c91b3 Fix undefined method error for NilClass
Add .try to prevent undefined method error for NilClass.
2013-10-23 07:47:15 -04:00
corwinkelly
1dc9e1ce7f Update workaround for "Outside the Scope of Strong Parameters"
The previous example of how to permit a hash of unknown keys used .tap, but had the side effect of logging an "Unpermitted parameters" message despite being a successful workaround. The proposed workaround is ever so slightly better, imo, because it won't result in an "Unpermitted parameters" message being logged.
2013-10-22 16:11:56 -04:00
Harshad Sabne
306651c7b3 Update 4_0_release_notes.md
Code Highlighted
2013-10-22 23:09:46 +05:30
David Verhasselt
eb6defbae9 Update docs on Tilt::Template in Asset Pipeline guide 2013-10-21 20:34:11 +03:00
Jay Hayes
614b203e1d Fixes typo 2013-10-20 19:51:19 -05:00
Harshad Sabne
e1e6be920d Update 3_2_release_notes.md
Code style adherence
2013-10-20 22:53:08 +05:30
Jay Hayes
da1d2fb483 Update I18n guide to note the additional features of the translate view helper 2013-10-19 10:33:47 -05:00
Rashmi Yadav
d96c5a8782 Updated 3.2.x link [ci skip] 2013-10-18 15:21:38 +02:00
Yves Senn
5824c6d0ed Merge pull request #12218 from dv/add-sass-globbing-to-asset-pipeline-docs
Add sass globbing to asset pipeline docs [ci skip]
2013-10-17 06:53:24 -07:00
David Verhasselt
4990a79347 Add Sass gobbling info to asset pipeline docs
[ci skip]
2013-10-17 14:32:26 +03:00
Juanito Fatas
01d75f038e [ci skip] Fix number of methods added by association.
Also clean up some trailing spaces on line 1143-1146.
2013-10-17 02:45:04 +08:00
Yves Senn
f2ca5aa5c2 Merge pull request #12545 from nateberkopec/rephrase_callback_warning
Rephrase ActiveRecord transaction rollback warning [ci skip]
2013-10-16 07:55:47 -07:00
Nate Berkopec
cb609b3975 Rephrase ActiveRecord transaction rollback warning
[ci skip]
2013-10-16 10:47:37 -04:00
Vijay Dev
403efc3b3a Merge branch 'master' of github.com:rails/docrails 2013-10-15 23:28:34 +05:30
Sıtkı Bağdat
a94186f836 Remove size alias for length validation
Removed ```The `size` helper is an alias for `length`.``` line. If you use this "nonexist" helper, you will get an error message like this: 

```
ArgumentError: Unknown validator: 'SizeValidator'
...
```

Maybe wanted to mean ```validates_size_of``` helper as an alias for ```validates_length_of``` helper.
2013-10-14 22:14:30 +03:00
Rafael Mendonça França
efad3b916f Merge pull request #12493 from drodriguez/patch-1
Keep code consistent with previous code blocks.
2013-10-13 10:04:37 -07:00
Rafael Mendonça França
2978af8a74 Merge pull request #12507 from malavbhavsar/doc_patch
Some fixes in docs [ci skip]
2013-10-12 19:22:40 -07:00
Sıtkı Bağdat
464def3ecf Fix a writing mistake
A small mistake found in the line of ```The default error is "can't be empty"``` for ```:presence``` helper. ```empty``` word changed to ```blank```.
2013-10-12 16:47:17 +03:00
Malav Bhavsar
ce46f20d13 Some fixes in docs [ci skip]
Update a link to point to right section in api docs

Fix a typo
2013-10-11 22:21:07 -07:00
Jeremy Kemper
365110196a Revert "Merge pull request #12480 from iwiznia/master"
This reverts commit e5f5a838b96a362534d9bb60d02334439ed9784c, reversing
changes made to d7567f3290a50952494e9213556a1f283a6cf3a0.
2013-10-11 13:05:29 -07:00
Ionatan Wiznia
90871f7198 flatten and flatten! methods for ActiveSupport::Duration 2013-10-11 12:50:23 +02:00
Daniel Rodríguez Troitiño
723c3881b9 Keep code consistent with previous code blocks.
[ci skip]
2013-10-10 18:38:04 +02:00
Cory Foy
7a1e7b38f2 Modifies the initialization guide to make the initializers process clearer and remove a TODO. [ci skip] 2013-10-09 16:16:12 -04:00
Francis Go
a46138c98e [Validations Guide] Add full stop to the end of sentence [ci skip] 2013-10-10 00:12:57 +11:00
Arun Agrawal
be8d8ba8b5 Added ActionView in rake about [ci skip] 2013-10-09 14:45:20 +02:00
AvnerCohen
f381759430 Minor align BR tags with HTML void - with reference to the generators code change - f038d4cc5f 2013-10-09 14:42:33 +02:00
Yves Senn
a0c0c1cbc1 Merge pull request #12283 from JuanitoFatas/rails-on-rack
[ci skip] Add explanation on Rack::Sendfile middleware in rails_on_rack.md.
2013-10-09 05:00:47 -07:00
Ulysse Carion
e2de7dc5ba Call rails plugin new yaffle in the plugins guide. [ci skip]
It's confusing to not explicitly do this step.
2013-10-08 08:14:51 -07:00
Juanito Fatas
2bd7b1e5b9 [ci skip] Add explanation on Rack::Sendfile and fix serve static files setting. 2013-10-04 16:36:10 +08:00
Geoffrey Roguelon
54c1cdf4ce Fix a typo in the code of Testing guide.
Replace the word «Accepts» by «Accept» in the example of custom request headers.
2013-10-03 10:26:19 +02:00
Xavier Noria
6be94d2927 copy-edits the new guide with our maintenance policy [ci skip] 2013-10-03 00:31:52 +02:00
Matias Korhonen
8045944e29 Adds the Rails maintenance policy to the Guides
[ci skip]
2013-10-03 00:39:29 +03:00
Sebastian Gassner
a6483437f1 guides: configuring: fixing explanation of :after_initialize hook
:after_initialize runs after config/initializers, not before
2013-10-01 13:31:06 +02:00
Jared Beck
6fae1efc59 fixes incorrect spelling of action_on_unpermitted_parameters
See `actionpack/test/controller/parameters/raise_on_unpermitted_params_test.rb`
2013-09-28 21:23:58 -04:00