- 05 2月, 2019 12 次提交
-
-
由 yuuji.yaginuma 提交于
Follow up to #35154.
-
由 Rafael França 提交于
Specify sqlite gem version explicitly in bug report templates
-
由 Rafael Mendonça França 提交于
Support before_reset callback in CurrentAttributes
-
由 Sergey Ponomarev 提交于
-
由 Aaron Patterson 提交于
Relax sqlite3 version dependency
-
由 Aaron Patterson 提交于
Refs: rails/jbuilder#452
-
由 Rafael Mendonça França 提交于
With this benchmark: require "bundler/setup" require "active_record" require "benchmark/ips" # This connection will do for database-independent bug reports. ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:") ActiveRecord::Schema.define do create_table :posts, force: true do |t| end end class Post < ActiveRecord::Base end new_post = Post.new Benchmark.ips do |b| b.report("present?") do new_post.present? end b.report("blank?") do new_post.blank? end end Before: Warming up -------------------------------------- present? 52.147k i/100ms blank? 53.077k i/100ms Calculating ------------------------------------- present? 580.184k (±21.8%) i/s - 2.555M in 5.427085s blank? 601.537k (± 9.2%) i/s - 2.972M in 5.003503s After: Warming up -------------------------------------- present? 378.235k i/100ms blank? 375.476k i/100ms Calculating ------------------------------------- present? 17.381M (± 7.5%) i/s - 86.238M in 5.001815s blank? 17.877M (± 6.4%) i/s - 88.988M in 5.004634s This improvement is mostly because those methods were hitting `method_missing` on a lot of levels to be able to return the value. To avoid all this stack walking we are short-circuiting those methods. Closes #35059.
-
由 Sergey Ponomarev 提交于
-
由 Rafael França 提交于
Cookie doesn't expire anymore unless a flag is set:
-
由 Vipul A M 提交于
Add a link to where "inquiry" is defined in ActiveSupport docs [ci skip]
-
由 Stephen Pike 提交于
[ci skip]
-
由 Gannon McGibbon 提交于
Cleanup the whitelisting references after #33145
-
- 04 2月, 2019 8 次提交
-
-
由 Eileen M. Uchitelle 提交于
Update template missing text in Guide
-
由 utilum 提交于
Changes the Getting Started guide explanation for `ActionController::MissingExactTemplate` error, to reflect the current message. Follow up for #29286, #35148 [ci skip]
-
由 garytaylor 提交于
-
由 Eileen M. Uchitelle 提交于
Invalidate all query caches for current thread
-
由 Eileen M. Uchitelle 提交于
Add ability to change the names of the default handlers
-
由 Edouard CHIN 提交于
- There is a regression in 6.0 introduced by #32937 where cookie doesn't expire anymore unless the new `use_cookies_with_metadata` configuration is set to `true`. This causes issue for app migration from 5.2 to 6.0 because the `use_cookies_with_metadata` flag can't be set to true until all servers are running on 6.0. Here is a small reproduction script that you can run in the console ```ruby ActionDispatch::Cookies request = ActionDispatch::Request.empty request.env["action_dispatch.key_generator"] = ActiveSupport::KeyGenerator.new('1234567890') request.env["action_dispatch.signed_cookie_salt"] = 'signed cookie' request.env["action_dispatch.cookies_rotations"] = ActiveSupport::Messages::RotationConfiguration.new request.env["action_dispatch.use_authenticated_cookie_encryption"] = true signed_cookie = request.cookie_jar.signed signed_cookie[:foobar] = { value: '123', expires: 1.day.ago } p signed_cookie[:foobar] ```
-
由 Kasper Timm Hansen 提交于
Fix and update template_missing image in guide
-
由 utilum 提交于
This commit updates the Missing Template image in the Getting Started Guide. The new image displays the current error message. Additionally: - New image is a PNG file, whereas the current image is in fact a misnamed JPEG. - New image is smaller. Before: ``` $ file --mime -b template_is_missing_articles_new.png image/jpeg; charset=binary $ du -h template_is_missing_articles_new.png 464K template_is_missing_articles_new.png ``` After: ``` $ file --mime -b template_is_missing_articles_new.png image/png; charset=binary $ du -h template_is_missing_articles_new.png 28K template_is_missing_articles_new.png ``` [ci-skip]
-
- 03 2月, 2019 2 次提交
-
-
由 Genadi Samokovarov 提交于
During the development of #33145, I have named a few concepts in the code as `whitelisted`. We decided to stay away from the term and I adjusted most of the code afterwards, but here are the cases I forgot to change. I also found a case in the API guide that we could have cleaned up as well. [ci skip]
-
由 Gannon McGibbon 提交于
Hint at advanced options for foreign_key
-
- 02 2月, 2019 15 次提交
-
-
由 Rafael França 提交于
Use consistent hash syntax for routes
-
由 Aaron Patterson 提交于
Introduce a file type template
-
由 Andy Waite 提交于
[ci skip]
-
由 Aaron Patterson 提交于
This commit passes the mutated source to the template handler as a parameter and deprecates the old handlers. Old handlers required that templates contain a reference to mutated source code, but we would like to make template objects "read only". This change lets the template remain "read only" while still giving template handlers access to the source code after mutations.
-
由 Aaron Patterson 提交于
Make Notifications::Fanout faster after changing subscriptions
-
由 Eileen Uchitelle 提交于
This change ensures that all query cahces are cleared across all connections per handler for the current thread so if you write on one connection the read will have the query cache cleared.
-
由 John Hawthorn 提交于
When adding/removing a subscription with a string pattern, it isn't necessary to clear the entire cache, only the cache for the key being added. When adding/removing subscriptions for a regex or to match all events, the full cache is still cleared.
-
由 John Hawthorn 提交于
Previously we stored all subscribers in an array, and every time a new message name came in asked each subscriber if they responded to the message. This commit changes Fanout to hash subscribers with a String pattern by their pattern. This way we can look them up directly and only do the O(N) scan over the non-string (Regex or any) patterns.
-
由 Aaron Patterson 提交于
Every template that specifies a "virtual path" loses the template source when the template gets compiled: https://github.com/rails/rails/blob/eda0f574f129fcd5ad1fc58b55cb6d1db71ea95c/actionview/lib/action_view/template.rb#L275 The "refresh" method seems to think that the source code for a template can be recovered if there is a virtual path: https://github.com/rails/rails/blob/eda0f574f129fcd5ad1fc58b55cb6d1db71ea95c/actionview/lib/action_view/template.rb#L171-L188 Every call site that allocates a template object *and* provides a "virtual path" reads the template contents from the filesystem: https://github.com/rails/rails/blob/eda0f574f129fcd5ad1fc58b55cb6d1db71ea95c/actionview/lib/action_view/template/resolver.rb#L229-L231 Templates that are inline or literals don't provide a "virtual path": https://github.com/rails/rails/blob/eda0f574f129fcd5ad1fc58b55cb6d1db71ea95c/actionview/lib/action_view/renderer/template_renderer.rb#L34 This commit introduces a `FileTemplate` type that subclasses `Template`. The `FileTemplate` keeps a reference to the filename, and reads the source from the filesystem. This effectively makes the template source immutable. Other classes depended on the source to be mutated while being compiled, so this commit also introduces a temporary way to pass the mutated source to the ERB (or whatever) compiler. See `LegacyTemplate`. I think we should consider it an error to provide a virtual path on a non file type template an non-file templates can't recover their source. Here is an example: https://github.com/rails/rails/blob/eda0f574f129fcd5ad1fc58b55cb6d1db71ea95c/actionview/lib/action_view/testing/resolvers.rb#L53 This provides a "virtual path" so the source code (a string literal) is thrown away after compilation. Clearly we can't recover that string, so I think this should be an error.
-
由 Eileen Uchitelle 提交于
When I wrote the `connected_to` and `connects_to` API's I wrote them with the idea in mind that it didn't really matter what the handlers/roles were called as long as those connecting to the roles knew which one wrote and which one read. With the introduction of the middleware Rails begins to assume it's `writing` and `reading` and there's no room for other roles. At GitHub we've been using this method for a long time so we have a ton of legacy code that uses different handler names `default` and `readonly`. We could rename all our code but I think this is better for a few reasons: - Legacy apps that have been using multiple databases for a long time can have an eaiser time switching. - If we later find this to cause more issues than it's worth we can easily deprecate. - We won't force old apps to rewrite the resolver middleware just to use a different handler. Adding the writing_role/reading_role required that I move the code that creates the first handler for writing to the railtie. If I didn't move this the core class would assign the handler before I was able to assign a new one in my configuration and I'd end up with 3 handlers instead of 2.
-
由 Eileen M. Uchitelle 提交于
Refactor options for database selector middleware
-
由 Rafael França 提交于
Eagerly materialize the fixtures transaction
-
由 Ryuta Kamizono 提交于
ActiveSupport typo fixes.
-
由 alkesh26 提交于
-
由 Eileen Uchitelle 提交于
Right now we only have one option that's supported, the delay. However I can see us supporting other options in the future. This PR refactors the options to get passed into the resolver so whether you're using middleware or using the config options you can pass options to the resolver. This will also make it easy to add new options in the future.
-
- 01 2月, 2019 3 次提交
-
-
由 Eileen M. Uchitelle 提交于
include the content type when uploading to S3
-
由 Eileen M. Uchitelle 提交于
Railties typo fixes.
-
由 alkesh26 提交于
-