Commit Graph

55822 Commits

Author SHA1 Message Date
Vipul A M
c96727135a - Remove dead links and take users to just the home page instead
- Add new logo for guides header
[ci skip]
2016-01-19 23:22:25 +05:30
Yves Senn
3ea4476942 run type column through attribtues API type casting.
Closes #21986.

This makes it possible to write custom types that define a different
mapping for STI columns.
2016-01-19 17:31:16 +01:00
Abdelkader Boudih
f8234313fe Merge pull request #23117 from vipulnsward/22297-ar-exception-raise
Mention that halting chain does not re-raise  `ActiveRecord::RecordIn…
2016-01-19 11:19:17 +00:00
प्रथमेश Sonpatki
1599868610 Merge pull request #23116 from vipulnsward/22648-html-safe-text
Make text about render :html option clearer to state, text will get e…
2016-01-19 16:02:10 +05:30
Vipul A M
8b0b0b0675 Mention that halting chain does not re-raise ActiveRecord::RecordInvalid exception as well, similar to ActiveRecord::Rollback
Fixes #22297

[ci skip]
2016-01-19 15:21:53 +05:30
Vipul A M
0764e67863 Make text about render :html option clearer to state, text will get escaped if not marked as safe by using html_safe
Fixes #22648
[ci skip]
2016-01-19 15:15:25 +05:30
Kasper Timm Hansen
a48f893cba Merge pull request #23114 from y-yagi/refer_to_rails_command_instead_of_rake_in_environment_error
refer to rails command instead of rake in environment error
2016-01-19 10:27:12 +01:00
yuuji.yaginuma
0e835960c7 refer to rails command instead of rake in environment error
It has been to use an overall rails command in ea4f0e2baba8653b03fba154357842933cf7b778, in order to unify.
2016-01-19 17:15:59 +09:00
Kasper Timm Hansen
bb4c63c703 Merge pull request #23112 from prathamesh-sonpatki/association-guides-fixes
Fix discrepancies in associations guide [ci skip]
2016-01-19 07:51:52 +01:00
Prathamesh Sonpatki
43c750bacb Fix discrepancies in associations guide [ci skip]
- Followup of 71ff088a09
2016-01-19 12:02:23 +05:30
प्रथमेश Sonpatki
034b2a7ca9 Merge pull request #23110 from amitsuroliya/application_record
`ApplicationRecord` instead of  `ActiveRecord::Base` in Association G…
2016-01-19 11:42:52 +05:30
amitkumarsuroliya
b4803e6ea7 ApplicationRecord instead of ActiveRecord::Base in Association Guides [ci skip] 2016-01-19 11:09:52 +05:30
Kasper Timm Hansen
be3d4c6ef6 Remove incomplete filter runs all tests in plugins.
Forgot to remove it, when I changed the expectations in 88881d2.
2016-01-18 22:10:26 +01:00
Kasper Timm Hansen
88881d2b50 Don't run all tests when files end in a colon.
If running `bin/rails t test/models/bunny_test.rb:` we'd implicitly run all the
tests in the bunny test. I now highly doubt that people would ever put in a line
filter without a line *and* want that to mean run all tests in that file.

Instead, change regex to require a line digit after the colon, so runs without a
line at the end would fail to require the test file.

This also has the side benefit of breaking requiring a file with many colons:
`bin/rails t test/models/bunny_test.rb:::::::::::::4`

Think this means I've had enough colonoscopy to last me through the year :)
2016-01-18 21:37:12 +01:00
Kasper Timm Hansen
426b3127dd Merge pull request #23099 from vipulnsward/change_start_at_end_at
Changed options for find_each and variants to have options start/finish
2016-01-18 19:57:10 +01:00
Kasper Timm Hansen
b505d45a5c Merge pull request #23006 from Edouard-chin/code_statistic_ignore_hidde_files
CodeStatistic will now ignore hidden files:
2016-01-18 19:47:17 +01:00
Edouard CHIN
ef233bba9a CodeStatistic will now ignore hidden files:
- Modify the default regex to not match hidden files
2016-01-18 12:56:20 -05:00
Jon Moss
75f1b229fd Merge pull request #21555 from amitsuroliya/associated_basics
Association Guide replaces Order as example with Author-Book Example …
2016-01-18 12:48:12 -05:00
amitkumarsuroliya
71ff088a09 Association Guide replaces Order as example with Author-Book Example [ci skip]
fixes #21500
2016-01-18 22:18:54 +05:30
Jon Moss
5f302eabae Merge pull request #22705 from RochesterinNYC/add-order-explanation-to-first-last-guides
Add clarification about `first` and `last` behavior when using `order` [ci skip]
2016-01-18 10:31:39 -05:00
Santiago Pastorino
eb2c0e23f9 Merge pull request #23088 from prathamesh-sonpatki/update-gemfile-lock
Checked in changes to Gemfile.lock on latest master
2016-01-18 11:40:42 -03:00
Jon Moss
721e45c90c Merge pull request #22394 from j-dexx/update_association_basics_guide
Updated the guides for having a distinct has_many through at the data…
2016-01-18 09:33:03 -05:00
Jon Moss
d95d680d68 Merge pull request #23096 from HayleyCAnderson/ha-action-cable-docs
[ci skip] Improve Action Cable configuration explanations
2016-01-18 09:30:42 -05:00
James Doyley
f72fe2d5a6 Updated the guides for having a distinct has_many through at the database level
The current example

    add_index :person_articles, :article, unique: true

Does not work, the `:article` column does not exist as it will be
a join table (based on the prior example) so should use :article_id

The documentation seems to suggest that it will allow an article to
be added only once to a person via the join table, what actually
occurs is that it only allows the article to be added to one person,
at which point it should be a `belongs_to` association.

Also changed the new example to use readings based on the prior example
2016-01-18 10:08:43 +00:00
Yves Senn
091b1ab58e Merge pull request #23097 from prathamesh-sonpatki/psql-hstore
Explain how HStore columns can be queried [ci skip]
2016-01-18 10:18:46 +01:00
Prathamesh Sonpatki
ad08072249 Explain how HStore columns can be queried [ci skip]
- Fixes #22876.
2016-01-18 14:39:50 +05:30
Vipul A M
da26934313 Changed options for find_each and variants to have options start/finish instead of start_at/end_at based on comments
at https://github.com/rails/rails/pull/12257#issuecomment-74688344
2016-01-18 12:40:30 +05:30
Kasper Timm Hansen
3bb6b7c713 Merge pull request #23098 from vipulnsward/changelog-pass
Pass through AP CHANGELOG
2016-01-18 07:41:47 +01:00
Vipul A M
ee14fbe4ee Pass through AP CHANGELOG [ci skip] 2016-01-18 12:05:23 +05:30
Hayley Anderson
04d4928e60 Improve Action Cable configuration explanations
* Clarify wording around how defaults work
* Clarify wording around what formatting versus information is required
* Separate consumer configuration section since it is important and wordy
* Add additional explanation of options for setting consumer configuration
* Consolidate consumer configuration information to reduce confusion
2016-01-18 00:22:00 -05:00
Kasper Timm Hansen
d14db3700d Merge pull request #23085 from maclover7/fix-17030
Remove AV dependence on AP's Mime
2016-01-17 20:30:55 +01:00
Jon Moss
98076af2ef Remove ActionView dependence on ActionPack's Mime implementation 2016-01-17 12:20:52 -05:00
Kasper Timm Hansen
2683dcc60e Merge pull request #23089 from kaspth/better-template-types
Enrich Action View Template types with symbols from Action Dispatch Mime.
2016-01-17 17:56:20 +01:00
Kasper Timm Hansen
91f2ad3682 Store the symbols as an array.
A Set can't be implicitly converted into an Array:

```
irb(main):012:0> formats = [ :rss ]
=> [:rss]
irb(main):013:0> formats &= SET.symbols
TypeError: no implicit conversion of Set into Array
    from (irb):13:in `&'
    from (irb):13
    from /Users/kasperhansen/.rbenv/versions/2.2.3/bin/irb:11:in `<main>'
```

Besides `Mime::SET.symbols` returns an Array, so we're closer to that.
2016-01-17 17:24:41 +01:00
Kasper Timm Hansen
85146f6de0 Enrich the SET constant to respond to symbols.
Match `Mime::SET.symbols`.
2016-01-17 17:23:58 +01:00
Kasper Timm Hansen
eb4ec6648d Don't bother looking up the types.
If they aren't symbols, then they aren't likely to be in the set anyway.
2016-01-17 16:31:13 +01:00
Kasper Timm Hansen
b1dcfa782e Replace class attribute with SET constant.
We'll be using this to map over to Action Dispatch's Mime::Set.
2016-01-17 16:31:13 +01:00
Kasper Timm Hansen
c10bb2996a Remove register abstraction.
The template types is a private abstraction to fill in basic blanks from Action Dispatch's
mime types. As such we can modify the data structure ourselves.
2016-01-17 16:31:12 +01:00
Kasper Timm Hansen
bb295be314 Replace delegate calls with standard method defs.
Spares a to_sym call by aliasing to_sym to ref.

Then the delegate felt meager for one method; ditch and define method ourselves.
2016-01-17 16:31:12 +01:00
Kasper Timm Hansen
f48098bd80 Spare to_sym call in ==.
The @symbol has already been converted to a symbol in initialize, so no need to call to_sym
when comparing it.

Ditch early return for a simple unless statement.
2016-01-17 16:31:03 +01:00
Kasper Timm Hansen
41ebb5564d Make ref return the internal symbol.
We delegate to_sym to the internal symbol, which we've already called to_sym on in
initialize, so we don't need to do that.

We also know to_sym will never return a falsy value, so we'll never hit to_s.

Just return the symbolized symbol.
2016-01-17 15:20:35 +01:00
Prathamesh Sonpatki
330469e7c7 Checked in changes to Gemfile.lock on latest master
- Eventmachine version gets updated when `bundle` is run locally.
2016-01-17 19:26:10 +05:30
eileencodes
5d1b7c3b44 Remove literal? check to fix issue with prefixed optionals
In commit d993cb3 `build_path` was changed from using `grep` to
`find_all` to save array allocations.

This change was a little too aggressive in that when the dash comes
before the symbol like `/omg-:song` the symbol is skipped.

Removing the check for `n.right.left.literal?` fixes this issue, but
does add back some allocations. The number of allocations are still well
less than before.

I've added a regression test to test this behavior for the future.

Fixes #23069.

Array allocations as of d993cb3:

```
{:T_SYMBOL=>11}
{:T_REGEXP=>17}
{:T_STRUCT=>6500}
{:T_MATCH=>12004}
{:T_OBJECT=>91009}
{:T_DATA=>100088}
{:T_HASH=>114013}
{:T_STRING=>159637}
{:T_ARRAY=>321056}
{:T_IMEMO=>351133}
```

Array allocations after this change:

```
{:T_SYMBOL=>11}
{:T_REGEXP=>1017}
{:T_STRUCT=>6500}
{:T_MATCH=>12004}
{:T_DATA=>84092}
{:T_OBJECT=>87009}
{:T_HASH=>110015}
{:T_STRING=>166152}
{:T_ARRAY=>322056}
{:T_NODE=>343558}
```
2016-01-16 15:00:18 -05:00
Eileen M. Uchitelle
cbb7f7d004 Merge pull request #23008 from tawan/avoid-multiple-default-paths
Avoid multiple default paths to server.pid file
2016-01-16 11:08:53 -05:00
Tawan Sierek
221b4aead5 Avoid multiple default paths to server.pid file
Fix bug (#22811) that occurs when rails server is started in daemon mode
and optional path to the `server.pid` file is omitted. Store default path
in a constant instead of evaluating it multiple time using `File.expand_path`.

The bug in detail: The server startup procedure crashes, since it tries to
open a file at `/tmp/pids/server.pid` instead of
`<path to project>/tmp/pids/server.pid`. This bug was introduced in 51211a94bd
when Rack was upgraded from version 1.x to 2.x. Since version 2.x,
Rack does not memoize the options hash [1], and as a consequence
`Rails::Server#default_options` will be evaluated multiple times.
The hash returned by `Rails::Server#default_options` holds the default path
to the `server.pid` file. The path is generated with the method
`File.expand_path`. However, the return value of this method depends on the
current working directory [2], which changes once `Process.daemon` is invoked
by `Rack::Server#daemonize_app` and the process is detached from the current
shell.

Close #22811

[1]https://git.io/vzen2
[2]http://ruby-doc.org/core-2.1.5/File.html#method-c-expand_path
2016-01-16 16:16:43 +01:00
David Heinemeier Hansson
39f383bad0 Fix the updated API (this sorts the concurrent-ruby switch with Basecamp) 2016-01-16 15:50:25 +01:00
David Heinemeier Hansson
01c320001b Revert "Merge pull request #22977 from rails/revert-22934-master"
This reverts commit d0393fccffc118a5de37654aa222774b66123393, reversing
changes made to 3b7ccadfc1c8dfec61af898167e1300b17f5cf25.
2016-01-16 15:42:20 +01:00
Rafael Mendonça França
f5065ef60c Merge pull request #20046 from yoongkang/ladida
Use ActiveSupport::SafeBuffer when flushing content_for
2016-01-16 04:23:27 -02:00
Rafael França
de2259791c Merge pull request #20005 from kamipo/default_expression_support
Add `:expression` option support on the schema default
2016-01-16 04:18:21 -02:00
Rafael França
cff9cd9fe7 Merge pull request #22985 from akshay-vishnoi/fix-typo
test `include?`- fix typo
2016-01-16 03:59:29 -02:00