Commit Graph

64678 Commits

Author SHA1 Message Date
Ryuta Kamizono
a9030737db Merge pull request #30640 from ydakuka/patch-1
Remove "the" [ci skip]
2017-09-18 14:21:45 +09:00
Yauheni Dakuka
76d373bc41 Remove "the" [ci skip] 2017-09-18 08:15:02 +03:00
Ryuta Kamizono
58c1dda4a2 Merge pull request #26707 from jcoleman/add_attribute_names_cache_busting_spec
Add test validating that Model.attribute_names cache is busted
2017-09-18 14:04:47 +09:00
Ryuta Kamizono
8cde75813d Remove unused delegation to reflection.options in Preloader::Association 2017-09-18 12:29:44 +09:00
Ryuta Kamizono
dae16f8cd5 The name of the key on the associated record is abstracted as reflection.join_primary_key 2017-09-18 12:14:20 +09:00
Ryuta Kamizono
a1aa86b99e The name of the key on the owner is abstracted as reflection.join_foreign_key 2017-09-18 11:42:29 +09:00
Ryuta Kamizono
9b1115ea34 Extract associate_records_to_owner to refactor Preloader::Association
Since we have `Preloader#preload`, `Preloader::Association#preload` is a
little confusing. And also, since the `preload` method is an abstract
method, it is hard to read where `associated_records_by_owner` is
called. This refactors `Preloader::Association` to ease to read where
`associated_records_by_owner` is called.
2017-09-18 11:03:59 +09:00
George Claghorn
f06266761c Merge pull request #30639 from yhirano55/remove_unused_require_in_activestorage_variation
Remove unused require in ActiveStorage::Variation
2017-09-17 21:07:07 -04:00
Yoshiyuki Hirano
0993cbe3e0 Remove unused require in ActiveStorage::Variation 2017-09-18 09:13:00 +09:00
Ryuta Kamizono
a714117736 Fix collided sequence name detection
If collided named sequence already exists, newly created serial column
will generate alternative sequence name. Fix sequence name detection to
allow the alternative names.
2017-09-18 08:36:51 +09:00
Ryuta Kamizono
9b53f74d89 Remove the code that swapping scope and options
`options` is never assigned to `scope` as long as using splat hash.
2017-09-18 08:25:02 +09:00
Ryuta Kamizono
37be1cb477 id (primary key) is not only an integer [ci skip] 2017-09-18 08:22:04 +09:00
Ryuta Kamizono
358360198e Ensure returning affected objects for class level update and destroy
Class level `update` and `destroy` are using `find` in the internal, so
it will raise `RecordNotFound` if given ids cannot find an object even
though the method already affect (update or destroy) to any objects.
These methods should return affected objects even in that case.
2017-09-18 08:12:59 +09:00
Ryuta Kamizono
9ac7dd47c5 Place class level update, destroy, and delete in Persistence::ClassMethods
The docs are obviously for class level `update`, `destroy`, and
`delete`. It should be placed in `Persistence::ClassMethods` rather than
`Relation`. And also, these methods are not dependent on relation. So it
is not needed to delegate to `all` (plus, `klass.find` is faster than
`relation.find`).
2017-09-18 08:12:59 +09:00
Ryuta Kamizono
4bb4824ae7 Early return if records.empty? in Preloader#preload 2017-09-18 08:08:24 +09:00
Ryuta Kamizono
5daf89f838 Don't pass reflection_scope to preload_scope if reflection.scope isn't given
Related 2b5f5cdd7c1d95716de6a206b6d09ccbb006dc17.

If `reflection.scope` isn't given, `reflection_scope` is always empty
scope. It is unnecessary to merge it.
2017-09-18 07:07:23 +09:00
Ryuta Kamizono
45588fef7e Return through_scope only if the scope is not empty scope
Related 2b5f5cdd7c1d95716de6a206b6d09ccbb006dc17.

If `through_scope` is empty scope, it is unnecessary to merge it.
And also, comparing relations is a little expensive (will cause
`build_arel`). It is enough to use `empty_scope?` to determine whether
empty scope.
2017-09-18 06:42:47 +09:00
Ryuta Kamizono
7f8f66e931 Remove useless condition in reset_association
`through_scope` is not empty scope if `options[:source_type]` is given.
2017-09-18 06:17:09 +09:00
Ryuta Kamizono
db844d9fb3 Merge pull request #30637 from bogdanvlviv/add_round_bracket_in_5_1_release_notes
Add missing round bracket in "Ruby on Rails 5.1 Release Notes" guide [ci skip]
2017-09-18 03:07:36 +09:00
bogdanvlviv
846990b488
Add missing round bracket in "Ruby on Rails 5.1 Release Notes" guide
[ci skip]
2017-09-17 20:41:22 +03:00
Ryuta Kamizono
45f2aa8c88 Merge pull request #30633 from yhirano55/add_mini_magick_to_app_generator
Add `mini_magick` to default `Gemfile` as comment
2017-09-18 00:32:34 +09:00
Ryuta Kamizono
84b134a80f Merge pull request #30632 from dixpac/fix_migration_rollback_docs
Fix docs describing rollback [ci skip]
2017-09-18 00:16:28 +09:00
Yoshiyuki Hirano
1df25e6f80 Add mini_magick to default Gemfile as comment
* If we want to transform image on ActiveStorage, we should bundle
  `mini_magick`.
* I've added comment block to default `Gemfile` to be easier to install this.
2017-09-17 23:53:41 +09:00
dixpac
7c4dad364c Fix docs describing rollback [ci skip]
* `rails db:migrate STEP = 2` will not rollback the migrations, instead
   `rails db:rollback STEP = 2` will do the rollback.
* Also, rewritten `rails db:migrate VERSION` => `rails db:rollback VERSION`
  for consistency.
2017-09-17 16:50:32 +02:00
Ryuta Kamizono
7300c679b9 Merge pull request #30630 from ydakuka/patch-1
Update plugins.md [ci skip]
2017-09-17 23:13:35 +09:00
Ryuta Kamizono
2402dd5588 Merge pull request #30628 from yhirano55/add_local_option_to_message_form
Add local option to Message form [ci skip]
2017-09-17 22:29:02 +09:00
Yauheni Dakuka
e484a2d109 Update plugins.md [ci skip] 2017-09-17 15:40:11 +03:00
Kasper Timm Hansen
fefc5e8e37 Merge pull request #30626 from yhirano55/fix_activestorage_readme
Fix file missing in activestorage's example code [ci skip]
2017-09-17 14:20:54 +02:00
Yoshiyuki Hirano
7d14bda3a7 Fix file missing in activestorage's example code [ci skip]
* File.open("~/face.jpg") raise error:
  `Errno::ENOENT: No such file or directory @ rb_sysopen - ~/face.jpg`
2017-09-17 21:00:23 +09:00
Kasper Timm Hansen
c46c80b529 Merge pull request #30609 from y-yagi/add_tests_for_credentials_command
Add tests for credentials command
2017-09-17 13:42:23 +02:00
Yoshiyuki Hirano
194a93385b Add local option to Message form [ci skip]
* MessagesController redirects to `GET /message/:id`.
* It looks it don't expect XHR request.
* `form_with` behaves for XHR by default.
* I've added `local: true` option to `form_with`.
2017-09-17 17:44:04 +09:00
Ryuta Kamizono
bf206dc2fc Merge pull request #30625 from y-yagi/remove_frozen_string_literal_from_templates
Remove frozen_string_literal magic comment from templates
2017-09-17 09:59:39 +09:00
yuuji.yaginuma
e0fa2ce961 Remove frozen_string_literal magic comment from templates
Follow up of #30348
2017-09-17 09:29:30 +09:00
George Claghorn
f8e4c837c7 Merge pull request #30617 from y-yagi/dont_expose_activestorage_routes
Don't expose Active Storage routes
2017-09-16 17:39:12 -04:00
Ryuta Kamizono
34956f7422 Merge pull request #30618 from y-yagi/fix_credentails
Fix typo: `credentails` -> `credentials` [ci skip]
2017-09-16 16:11:32 +09:00
yuuji.yaginuma
8a3cf5340c Fix typo: credentails -> credentials [ci skip]
Follow up of ca18922ac23be2cde6963fae9b193c9111bec6f8
2017-09-16 16:06:04 +09:00
yuuji.yaginuma
3bf95f9513 Don't expose Active Storage routes
These routes are only used internally in Active Storage, and it seems
that there is no need for the user to directly use them.

Therefore, I think that routes should not be exposed to users.
2017-09-16 14:54:51 +09:00
Kasper Timm Hansen
81a2e1cb27 Merge pull request #30608 from yhirano55/add_local_option_to_form_with
Update Getting Started with Rails [ci skip]
2017-09-15 15:52:12 +02:00
yuuji.yaginuma
8a331566bf Add tests for credentials command 2017-09-15 14:31:02 +09:00
Yoshiyuki Hirano
0e573a5fb8 Update Getting Started with Rails [ci skip] 2017-09-15 14:25:25 +09:00
Matthew Draper
536d3068b9 Remove stopgap_13632 entirely for now: it doesn't support 2.2.8 2017-09-15 12:32:04 +09:30
Matthew Draper
3559daddfe Stick with the RUBY_VERSION check on stopgap_13632 2017-09-15 12:11:36 +09:30
Matthew Draper
71f0db7c7f Bump Travis to new Ruby releases
Most interesting to us, 2.4.2 and 2.3.5 include the fix for
https://bugs.ruby-lang.org/issues/13632
2017-09-15 11:42:49 +09:30
Kasper Timm Hansen
31a8e7c626
Inline the lone add_master_key_file_silently use. 2017-09-14 20:38:24 +02:00
Kasper Timm Hansen
9fa883143a Merge pull request #30582 from y-yagi/do_no_add_master_key_and_credentials
Do not add master key and credentials when `pretend` option is specified
2017-09-14 20:16:38 +02:00
Kasper Timm Hansen
43fbfb483f Merge pull request #30581 from y-yagi/do_not_add_master_key_twice_to_gitignore
Make master key added to gitignore the same value as when creating appplication
2017-09-14 20:14:26 +02:00
George Claghorn
cffa32f95d Avoid making HTTP requests to generate signed URLs for GCS objects 2017-09-13 22:44:04 -04:00
Ryuta Kamizono
f27a45af46 Remove unused explicit delegation to klass in relation
It is only used `primary_key` and `connection` in the internal, so it is
not needed to delegate others to `klass` explicitly.
This doesn't change public behavior because `relation` will delegate
missing method to `klass`.
2017-09-14 10:45:28 +09:00
Ryuta Kamizono
bdc2ba0ec9 Don't use collection.table_name in collection_cache_key
Because `collection.table_name` doesn't respect table alias.
Use `collection.arel_attribute` instead.
2017-09-14 10:17:28 +09:00
Ryuta Kamizono
f904700ba4 Merge pull request #30598 from yhirano55/update_activejob_basics
Update Active Job Basics [ci skip]
2017-09-14 09:35:16 +09:00