Commit Graph

58803 Commits

Author SHA1 Message Date
Richard Schneeman
ee50de0390 Merge pull request #25241 from aguynamedben/fix-touch-error-messages
Improve error message when record touch fails.
2016-07-03 10:35:31 -05:00
Vipul A M
9a53b0f44a
- Update Syntax Highlighter to version 4.
- Build Syntax Highlighter based on https://github.com/syntaxhighlighter/syntaxhighlighter/wiki/Building and use theme generated by fxn.
- This also bundles these brushes in the file itself- ruby,css,xml,sql,javascript,plain. Generation command used:
gulp build --compat --brushes=javascript,ruby,xml,sql,plain --theme=/Path/To/RailsSource/rails/guides/assets/stylesheets/syntaxhighlighter/shThemeRailsGuides.css
- rm all old js and css files
- Moved over how JS configuration is created for Syntax Highlighter
- Fixed layout for all imports
- Fixes bug with old copy paste, generating wrong space character on webkit 7caa9632e7/src/dom.js (L227)

 Fixes #25655
2016-07-03 00:20:27 -07:00
Vipul A M
5324665e9f
Expand on Instance variables section with an example and specify when the instance variables are set.[ci skip] 2016-07-02 21:50:49 -07:00
Vipul A M
d3c444fb3b Merge pull request #25661 from will-in-wi/clarify_postgres_docs
Clarify Postgres initials. [skip ci]
2016-07-02 18:57:08 -07:00
William Johnston
b7f4b8e0bf Clarify Postgres initials. [skip ci] 2016-07-02 20:49:57 -05:00
Vipul A M
514db122cd Merge pull request #25658 from will-in-wi/fix_rails_5_attributes_docs
Update Rails 5 release notes with syntax fixes. [ci skip]
2016-07-02 16:18:15 -07:00
Ben Standefer
ac156060a4 Improve error message when record touch fails.
The current error message only indicates that a touch can fail because the record is new. In practice, we saw cases where touches were failing because the record had been destroyed. `persisted?` checks `new_record?` *and* `destroyed?`. It was confusing to get a message about a new record when in reality we were destroying records.

I also included a helpful tip for users to consider using `persisted?`, `new_record?`, or `destroyed?` before touching.
2016-07-02 16:16:56 -07:00
William Johnston
b96e5ea2e1 Update Rails 5 release notes with syntax fixes. 2016-07-02 18:13:35 -05:00
Vipul A M
919e705362
travel/travel_to travel time helpers, now raise on nested calls,
as this can lead to confusing time stubbing.

     Instead of:

         travel_to 2.days.from_now do
           # 2 days from today
           travel_to 3.days.from_now do
             # 5 days from today
           end
         end

     preferred way to achieve above is:

         travel_to 2.days.from_now
         # 2 days from today

         travel_back
         travel_to 5.days.from_now
         # 5 days from today

Closes #24690
Fixes #24689
2016-07-02 15:09:34 -07:00
Vipul A M
6a77398cc1 Merge pull request #25657 from htanata/fix_typo
Fix typo: accidently -> accidentally. [ci skip]
2016-07-02 15:06:38 -07:00
Hendy Tanata
5d9d309097 Fix typo: accidently -> accidentally. 2016-07-02 12:38:21 -07:00
Matthew Draper
a468774cc1 Merge pull request #25293 from y-yagi/remove_needless_comments
remove needless comments
2016-07-03 04:08:30 +09:30
Vipul A M
49fe7c6687 Merge pull request #25647 from aditya-kapoor/correct-guide-command
Correct guide generation command [ci skip]
2016-07-02 02:52:17 -07:00
Aditya Kapoor
3f7d85bdd5 Correct guide generation command [ci skip] 2016-07-02 15:18:27 +05:30
Vipul A M
44c7507657
Fix number_with_precision documentation for precision [ci skip] 2016-07-02 02:42:43 -07:00
Sean Griffin
01091ae6c9 Merge pull request #25638 from kamipo/remove_unused_predicate_builder
Remove unused `predicate_builder` for `BasicObjectHandler` and `RangeHandler`
2016-07-02 11:40:31 +02:00
Vipul A M
d272b6f187 Merge pull request #25644 from Edouard-chin/forgotten-doc-removal
`partial` option on the digest method is no more needed [ci skip]:
2016-07-02 02:25:30 -07:00
Vipul A M
bda7ef08f4 Merge pull request #25646 from y-yagi/refer_to_rails_command_instead_of_rake
refer to rails command instead of rake in doc of `SourceAnnotationExtractor`
2016-07-02 02:18:06 -07:00
yuuji.yaginuma
45ecfc082a refer to rails command instead of rake in doc of SourceAnnotationExtractor [ci skip] 2016-07-02 18:16:04 +09:00
Matthew Draper
edc5603b1d Merge pull request #25222 from vipulnsward/25219-fix-logs
Clean backtrace in IRB
2016-07-02 16:40:05 +09:30
Edouard CHIN
412b785ec4 partial option on the digest method is no more needed [ci skip]:
- `partial` option is not used anymore, this was removed in https://github.com/rails/rails/pull/23724
2016-07-02 01:55:29 -04:00
Rafael Mendonça França
8fb6995714
Try the newest bundler 2016-07-02 00:58:54 -03:00
Rafael França
c73fd517d1 Merge pull request #25639 from y-yagi/followup_to_25431
fix task name to remove
2016-07-02 00:46:05 -03:00
yuuji.yaginuma
1bd694e586 fix task name to remove
Follow up to #25431
2016-07-02 12:41:16 +09:00
Rafael França
e12e7a8f87 Merge pull request #25507 from bquorning/optimize-for-first-result-and-remove-mysql-select_one
Remove #select_one from Mysql2Adapter
2016-07-02 00:06:04 -03:00
Rafael França
193d907981 Merge pull request #24177 from vipulnsward/rename-test
Renamed NestedParametersTest to NestedParametersPermitTest
2016-07-01 23:53:34 -03:00
Rafael França
009333fb35 Merge pull request #25631 from yahonda/revert_rename_to_ar_internal_metadata
Revert "Rename `active_record_internal_metadatas` to `ar_internal_metadata"
2016-07-01 23:21:52 -03:00
Rafael França
501741c3d1 Merge pull request #25633 from kamipo/remove_create_table_info_cache
Remove `create_table_info_cache` because it not be reused
2016-07-01 23:17:24 -03:00
Ryuta Kamizono
766e82b02f Remove unused predicate_builder for BasicObjectHandler and RangeHandler 2016-07-02 10:38:51 +09:00
Rafael Mendonça França
fbd1e98cf9
Do not run bundle install when generating a new plugin.
Since bundler 1.12.0, the gemspec is validated so the `bundle install`
command will fail just after the gem is created causing confusion to the
users. This change was a bug fix to correctly validate gemspecs.
2016-07-01 22:19:47 -03:00
Rafael França
14996a1490 Merge pull request #25625 from voxik/fix-rails-test-git-layout
Do not depend on Rails git repository layout in ActiveSupport tests.
2016-07-01 21:18:12 -03:00
Rafael França
71acc3bd01 Merge pull request #25620 from kamipo/create_without_primary_key
Pass `pk: false` to `connection.insert` explicitly if do not have a primary key
2016-07-01 21:12:49 -03:00
Vipul A M
8e1714b2f5
- Added test for verifying that we treat line number indications from irb as user/lib code
- Cleaned up backtrace cleaner test code and removed instaces variables
2016-07-01 16:57:45 -07:00
Vipul A M
1eb358299c
Fixes #25219
Add handling of cleaning up backtrace from IRB console in case of errors
2016-07-01 15:47:06 -07:00
Kasper Timm Hansen
173bf3506d Fix conditional order broken in ea40ec56. 2016-07-02 00:16:12 +02:00
Matthew Draper
ad95b6fc72 Merge pull request #25344 from matthewd/debug-locks
ActionDispatch::DebugLocks
2016-07-02 06:47:57 +09:30
Matthew Draper
f0c7e2b8c3 Merge pull request #24146 from matthewd/latch-as-proxy
Don't inherit from Concurrent::CountDownLatch
2016-07-02 06:47:38 +09:30
Matthew Draper
803ee80c88 Merge pull request #25615 from tinco/close_hijacked_socket
close hijacked i/o socket after use (fixes #25613)
2016-07-02 06:38:43 +09:30
Tinco Andringa
3120b51de7 close hijacked i/o socket after use (fixes #25613) 2016-07-01 23:03:30 +02:00
Matthew Draper
1c7a3230ba Ensure logging on exceptions only includes what we expect 2016-07-02 06:09:10 +09:30
Genadi Samokovarov
40fc3874f0 Silence DebugExceptions template render logs during exceptions
When an exception is raised, those Action View rendering logs are just
noise for the end developer. I recently silenced those from Web Console,
as we do use Action View rendering in it as well. It used created a half
a screen of rendering logs. I think we can save those in this recent
push for cleaner development logs.

Now, the silencing is a bit hacky and we have a bunch of it now, so we
can also invest in turning off the logs directly from Action View
objects instead of silencing off the logging stream.
2016-07-02 06:09:10 +09:30
Kasper Timm Hansen
ea40ec56ba Make mutation stand out some more.
Felt that += overwriting the path variable was a little too hidden.

Make the outcomes easier to spot with an if-else branch.
2016-07-01 22:33:39 +02:00
Kasper Timm Hansen
7f0d415eb7 Merge pull request #25632 from volmer/fix-integration-test-frozen-literals
Fix request encoding in tests when string literals are frozen
2016-07-01 22:22:10 +02:00
Vipul A M
d7a7a2561a Merge pull request #25600 from pan/constantize-docfix
fix ActiveSupport::Infector.constantize usage API doc [ci skip]
2016-07-01 13:20:02 -07:00
Ryuta Kamizono
bf63bc7b41 Remove create_table_info_cache because it not be reused
`create_table_info_cache` is used for sharing `create_table_info` both
`table_options` and `foreign_keys`. But `foreign_keys` no longer uses
`create_table_info_cache` by #25307. No need caching anymore.
2016-07-02 05:15:35 +09:00
Volmer
fa10787447 Fix request encoding in tests when string literals are frozen
When running tests with `--enable-frozen-string-literal` or
`# frozen_string_literal: true`, it's currently attempted to mutate the path
string in order to append the format, causing a `RuntimeError`.

```ruby
get '/posts', as: :json
```

```
RuntimeError:
 can't modify frozen String
```

This commit fixes the problem by replacing the mutation with a concatenation,
returning a new string.
2016-07-01 15:16:28 -04:00
Yasuo Honda
545583d773 Revert "Rename active_record_internal_metadatas to ar_internal_metadata"
This reverts commit 407e0ab5e5cddf6a8b6b278b12f50772d13b4d86.
2016-07-01 17:38:52 +00:00
eileencodes
0d8d64e9d0 Add regression test for foreign key schema dump caching
If you had a foreign key set and then decided to add `on_delete:
:cascade` later in another migration that migration would run but
wouldn't refresh the schema dump.

The reason for this was because `create_table_info` caches the statement
and sets it to be the same as the original declaration for the foreign
key (without the `on_delete: :cascade`.

PR #25307 ended up fixing this bug because it removes the check for
`create_table_info` and relies on reading from `information_schema`. The
fix however was intended to patch another bug. The reason this fixes the
issue is we're no longer parsing the regex from the cached
`create_table_info`.

This regression test is to ensure that the issue does not return if we
for some reason go back to using `create_table_info` to set the foreign
keys.
2016-07-01 11:43:46 -04:00
Eileen M. Uchitelle
4abd389ef7 Merge pull request #25307 from kamipo/extract_foreign_key_action_from_information_schema
Extract foreign key action from `information_schema`
2016-07-01 11:30:40 -04:00
eileencodes
297e262035 Fix release task now that NPM is part of the build
Note: this commit looks super weird becuase git. I'm moving the entire
NPM section to the part where we actually push the gems/npm package for
the reasons below. That's not how the git diff looks though.

When we release Rails we run `rake prep_release` which calls
`update_versions`. This was updating the NPM version as well. But when we
would later run `rake install` to test the installed gem
`update_versions` gets called again which causes the install to fail
because NPM sees the version is the same as the last run and refuses to
continue. If you forget to stash this will then cause the push to
RubyGems to fail because `update_versions` is called again and then NPM
will not continue because it thinks the version hasn't been changed even
though it has.

The correct solution would be to not update the NPM verion if it matches
the version already in the file but after an hour I could not find a
simple way to use NPM to read the current version. Honestly that's not
the best way to do it either because say you forget to update something
else and then the script thinks it's already been updated.

With that in mind I think the best solution is to not update the NPM
version until right before we are going to push to NPM because then that
won't cause the push to RubyGems to fail.
2016-07-01 10:58:06 -04:00