- 27 7月, 2018 13 次提交
-
-
由 George Claghorn 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
Add event object subscriptions to AS::Notifications
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
We don't need to have a special subscribe method for objects. The regular `subscribe` method is more expensive than a specialized method, but `subscribe` should not be called frequently. If that turns out to be a hotspot, we can introduce a specialized method. :)
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
Fanout notifier can send event objects to subscribers now. Also moved `end` lower in the `finish!` method to guarantee that CPU time is shorter than real time.
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
Add cpu time, idle time, and allocations features to log subscriber events
-
由 Eileen Uchitelle 提交于
* Use process clock instead of Time.now This fixes any issues with the system clock changing and also eliminates 2 object allocations per event. * Add start! and finish! methods to the event object so we can record more information * Adds cpu time, idle time, and allocation count for a particular event. Co-authored-by: NAaron Patterson <aaron.patterson@gmail.com>
-
由 George Claghorn 提交于
Bump RuboCop to 0.58.2
-
由 Eileen M. Uchitelle 提交于
Remove third party FIXME
-
- 26 7月, 2018 10 次提交
-
-
由 George Claghorn 提交于
AST Guide: install and migrate tasks needed in new app
-
由 Jasper Martin 提交于
Do nothing instead of raising an error when it’s called on an attached blob.
-
由 utilum 提交于
This line refers only to an upgrade situation, but same is need to setup AST in a new application. [ci skip]
-
由 Koichi ITO 提交于
## Summary RuboCop 0.58.2 was released. https://github.com/rubocop-hq/rubocop/releases/tag/v0.58.2 And rubocop-0-58 channel is available in Code Climate. https://github.com/codeclimate/codeclimate/releases/tag/v0.76.0 https://github.com/codeclimate/codeclimate/commit/38f21f0 In addition, the following changes are made in this PR. - Replace Custom cops with Rails cops - Add jaro_winkler gem to Gemfile.lock ### Replace Custom cops with Rails cops These are compatible replacements. - Replace `CustomCops/AssertNot` cop with `Rails/AssertNot` cop. - Replace `CustomCops/RefuteNot` cop with `Rails/RefuteMethods` cop. With this replacement, it was decided to use cop of RuboCop itself. It removes the code related to CustomCops accordingly. ### Add jaro_winkler gem to Gemfile.lock Since RuboCop 0.57.0 depends on jaro_winkler gem, it has been added to Gemfile.lock.
-
由 Ryuta Kamizono 提交于
Reference Active Storage instead of third-party libraries in guide [ci skip]
-
由 Paul McMahon 提交于
Paperclip has officially been deprecated, so we shouldn't mention it anymore. CarrierWave could still be referenced, as there are use cases where it currently makes more sense, but for simplicity, I thought removing the mention of third party libraries made sense. If we want to talk about them, listing "alternatives" within the Active Storage guide could make more sense.
-
由 Richard Schneeman 提交于
Turn on performance based cops
-
由 Alberto Almagro 提交于
This FIXME belongs to a code example that was imported from the internet. As we aren't going to do anything about it, I prefer to remove it so it stops from appearing on searches.
-
由 George Claghorn 提交于
Update with_options.rb [ci skip]
-
由 Daniel Amireh 提交于
explicit mapping for enum accepts a Hash not an Array, plus the example is using `.keys` which also exists on hash
-
- 25 7月, 2018 2 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up of #33358 for SQLite3.
-
由 Matthew Draper 提交于
Prefer rails command over bin/rails
-
- 24 7月, 2018 4 次提交
-
-
由 Eileen M. Uchitelle 提交于
Rails guides are now served over https
-
由 Paul McMahon 提交于
http links will be redirected to the https version, but still better to just directly link to the https version.
-
由 Dillon Welch 提交于
Use attr_reader/attr_writer instead of methods method is 12% slower Use flat_map over map.flatten(1) flatten is 66% slower Use hash[]= instead of hash.merge! with single arguments merge! is 166% slower See https://github.com/rails/rails/pull/32337 for more conversation
-
由 Eileen M. Uchitelle 提交于
[ci skip] Change the text color which wrapped by code tag.
-
- 23 7月, 2018 2 次提交
-
-
由 Ryuta Kamizono 提交于
Add strict argument checking to ActiveRecord callbacks
-
由 Sean Linsley 提交于
This ends up adding it to all save-related callbacks defined in `ActiveRecord::DefineCallbacks`, including e.g. `after_create`. Which should be fine: they didn't support `:on` in the first place.
-
- 22 7月, 2018 9 次提交
-
-
由 George Claghorn 提交于
[ci skip] Use consistent hash syntax in AR docs
-
由 George Claghorn 提交于
[ci skip] fix typo in Active Record Associations guide
-
由 George Claghorn 提交于
[ci skip] Tidy up formatting of (consecutive) examples
-
由 K. Rodman Mannix 提交于
-
由 Richard Schneeman 提交于
[ci skip] Document render options
-
由 Alireza Bashiri 提交于
Complete renderer documentation Fixes #28484
-
由 Orhan Toy 提交于
The consecutive verbatim blocks were being merged making the output look weird.
-
由 Orhan Toy 提交于
The examples with `.where` uses hash w/ symbol keys so it would be more consistent to also do this with `.new`. Also from my experience the hash w/ symbol keys is more widely used with `where/new/create` etc. in ActiveRecord.
-
由 Aaron Kromer 提交于
* Add implicit to path conversion to uploaded file Ruby has a few implicit conversion protocols (e.g. `to_hash`, `to_str`, `to_path`, etc.). These are considered implicit conversion protocols because in certain instances Ruby (MRI core objects) will check if an argument responds to the appropriate protocol and automatically convert it when it does; this is why you can provide a `Pathname` instance into `File.read` without having to explicitly call `to_s`. ```ruby a_file_path = 'some/path/file.ext' File.write a_file_path, 'String Path Content' File.read a_file_path a_pathname = Pathname(a_file_path) File.write core_file, 'Pathname Content' File.read a_file_path core_file = File.new(a_pathname) File.write core_file, 'File Content' File.read core_file tmp_file = Tempfile.new('example') File.write tmp_file, 'Tempfile Content' File.read tmp_file ``` So how does an uploaded file work in such cases? ```ruby tmp_file = Tempfile.new('example') File.write tmp_file, 'Uploaded Content' uploaded_file = ActionDispatch::Http::UploadedFile.new(tempfile: tmp_file) File.read uploaded_file ``` It fails with a `TypeError`: no implicit conversion of ActionDispatch::Http::UploadedFile into String In order to make an uploaded file work it must be explicitly converted to a file path using `path`. ```ruby File.read uploaded_file.path ``` This requires any code that expects path/file like objects to either special case an uploaded file, re-implement the path conversion protocol to use `path`, or forces the developer to explicitly cast uploaded files to paths. This last option can sometimes be difficult to do when such calls are deep within the inner workings of libraries. Since an uploaded file already has a path it makes sense to implement the implicit "path" conversion protocol (just like `File` and `Tempfile`). This change allows uploaded file content to be treated more closely to regular file content, without requiring any special case handling or explicit conversion for common file utilities. * Note uploaded file path delegation in CHANGELOG
-