- 14 12月, 2017 1 次提交
-
-
由 Olivier Lacan 提交于
This new ActiveRecord configuration option allows you to easily pinpoint what line of application code is triggering SQL queries in the development log by appending below each SQL statement log the line of Ruby code that triggered it. It’s useful with N+1 issues, and to locate stray queries. By default this new option ignores Rails and Ruby code in order to surface only callers from your application Ruby code or your gems. It is enabled on newly generated Rails 5.2 applications and can be enabled on existing Rails applications: ```ruby Rails.application.configure do # ... config.active_record.verbose_query_logs = true end ``` The `rails app:upgrade` task will also add it to `config/development.rb`. This feature purposely avoids coupling with ActiveSupport::BacktraceCleaner since ActiveRecord can be used without ActiveRecord. This decision can be reverted in the future to allow more configurable backtraces (the exclusion of gem callers for example).
-
- 20 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 02 7月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
This reverts commit 3420a145, reversing changes made to afb66a5a.
-
- 01 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 17 5月, 2017 1 次提交
-
-
由 Yasuo Honda 提交于
Addresses #29021
-
- 16 5月, 2017 1 次提交
-
-
由 Yasuo Honda 提交于
Address #29021 Since Ruby 2.5.0-dev does not return decimal value when it is 0. This change has been made at Ruby 2.5.0-dev between `(2017-05-05 trunk 58572)` and `(2017-05-07 trunk 58586)`, likely Revision 58586. This fix has been tested with these Ruby versions: * ruby 2.5.0dev (2017-05-15 trunk 58733) [x86_64-linux] * ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux] * ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-linux] * ruby 2.2.7p470 (2017-03-28 revision 58194) [x86_64-linux] [Yasuo Honda & Ryuta Kamizono]
-
- 07 5月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 29 4月, 2017 1 次提交
-
-
由 Jon Moss 提交于
Just use one `Event` class. Reduces duplication, makes the tests easier to read. It might seem like each tests needs a different kind of Struct, since we make a new one for each test case.
-
- 07 8月, 2016 3 次提交
-
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
-
- 11 5月, 2016 1 次提交
-
-
由 Jon Moss 提交于
If an attribute was of the binary type, and also was a Hash, it would previously not be logged, and instead raise an error saying that `bytesize` was not defined for the `attribute.value` (a `Hash`). Now, as is done on 4-2-stable, the attribute's database value is `bytesize`d, and then logged out to the terminal. Reproduction script: ```ruby require 'active_record' require 'minitest/autorun' require 'logger' ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') ActiveRecord::Base.logger = Logger.new(STDOUT) ActiveRecord::Schema.define do create_table :posts, force: true do |t| t.binary :preferences end end class Post < ActiveRecord::Base serialize :preferences end class BugTest < Minitest::Test def test_24955 Post.create!(preferences: {a: 1}) assert_equal 1, Post.count end end ```
-
- 05 11月, 2015 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 18 7月, 2015 1 次提交
-
-
由 Peter Boling 提交于
- Improves coloring for statements like: # Become WHITE SELECT * FROM ( SELECT * FROM mytable FOR UPDATE ) ss WHERE col1 = 5; LOCK TABLE table_name IN ACCESS EXCLUSIVE MODE; # Becomes RED ROLLBACK - Reinstates the coloration of the `payload[:name]`. Instead of simple alternating colors, adds meaning: - `MAGENTA` for `"SQL"` or `blank?` payload names - `CYAN` for Model Load/Exists - Introduces specs for sql coloration. - Introduces specs for payload name coloration. GH#20885
-
- 28 1月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
`bound_attributes` is now used universally across the board, removing the need for the conversion layer. These changes are mostly mechanical, with the exception of the log subscriber. Additional, we had to implement `hash` on the attribute objects, so they could be used as a key for query caching.
-
- 11 1月, 2015 1 次提交
-
-
由 Sean Griffin 提交于
There's very little value in logging "<NULL binary data>" instead of just "nil". I'd like to remove the column from the equation entirely, and this case is preventing us from doing so.
-
- 03 5月, 2014 1 次提交
-
-
由 James Coleman 提交于
-
- 08 11月, 2013 1 次提交
-
-
由 Rafael Mendonça França 提交于
We can conditional define the tests depending on the adapter or connection. Lets keep the skip for fail tests that need to be fixed.
-
- 19 6月, 2013 1 次提交
-
-
由 Neeraj Singh 提交于
If I have a query that produces sql `WHERE "users"."name" = 'a b'` then in the log all the whitespace is being squeezed. So the sql that is printed in the log is `WHERE "users"."name" = 'a b'`. This can be confusing. This commit fixes it by ensuring that whitespace is not squeezed. fixes #10982
-
- 08 1月, 2013 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
Some tests were raising the following error: Could not log "sql.active_record" event. NoMethodError: undefined method `type' for nil:NilClass` Due to the way binds were being logged, the column info was considered always present, but that is not true for some of the tests listed in the issue. Closes #8806.
-
- 19 12月, 2012 1 次提交
-
-
由 Yasuo Honda 提交于
The number of sql statement logged depends on each database adapter implementation. Also, this test does not depends on how many sql statement executed.
-
- 15 12月, 2012 2 次提交
-
-
由 Carlos Antonio da Silva 提交于
Mysql2 doesn't support binds, which means no binds payload is set when logging, so the logic to render binary data differently here doesn't work. Introduced in 99d142a9.
-
由 Matthew M. Boedicker 提交于
They tend to be large and not very useful in the log.
-
- 03 8月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
On reflection, it seems like a bit of a weird method to have on ActiveRecord::Base, and it shouldn't be needed most of the time anyway.
-
- 27 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
Previously it returned an Array. If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This is more explicit. In most cases this should not break existing code, since Relations use method_missing to delegate unknown methods to #to_a anyway.
-
- 14 3月, 2012 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
- 20 12月, 2011 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 08 12月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 23 6月, 2011 1 次提交
-
-
由 Jon Guymon 提交于
-
- 07 6月, 2011 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 05 6月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
-
- 02 5月, 2011 1 次提交
-
-
由 José Valim 提交于
-
- 06 4月, 2011 1 次提交
-
-
由 Emilio Tagua 提交于
Disable IdentityMap in log tests, it's not important and when running tests rake task it logs more messages in the tested buffer. Signed-off-by: NJosé Valim <jose.valim@gmail.com>
-
- 29 3月, 2011 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 27 7月, 2010 1 次提交
-
-
由 José Valim 提交于
-
- 26 7月, 2010 4 次提交
-
-
由 José Valim 提交于
-
由 José Valim 提交于
* AS::Notifications#instrument should not measure anything, it is not its responsibility; * Adding another argument to AS::Notifications#instrument API needs to be properly discussed;
-
由 Aaron Patterson 提交于
-
由 José Valim 提交于
-
- 21 7月, 2010 1 次提交
-
-
由 Santiago Pastorino 提交于
Signed-off-by: NJosé Valim <jose.valim@gmail.com>
-