pp_sql 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pp_sql/version.rb +1 -1
- data/lib/pp_sql.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ef86d80e34ffbcc0571c4ebc6665fcccf7a4334a
|
|
4
|
+
data.tar.gz: 579204bf9e2d3a6ab2cd8e0920ee47708122853b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8182ceb7776fbef62222b9385bd2cdebc83c5989a1100e3b74c047ef4f3dc7e44b3a590ab13554c6656129728e675159ef736c7e108760a30fbb50a02b718581
|
|
7
|
+
data.tar.gz: e77d0e2bfbad68ac272d8a04741550e193fcecbd9bd5d687161262884f3aae5d2eb45f68c4f7107c146030aeaca9f38dbadcedafb82278d18a8bb114412e7754
|
data/lib/pp_sql/version.rb
CHANGED
data/lib/pp_sql.rb
CHANGED
|
@@ -22,8 +22,10 @@ module PpSql
|
|
|
22
22
|
puts to_sql
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
|
-
module
|
|
25
|
+
module Rails5PpSqlExtraction
|
|
26
26
|
# export from Rails 5 with for Rails 4.2+ versions
|
|
27
|
+
private
|
|
28
|
+
|
|
27
29
|
def colorize_payload_name(name, payload_name)
|
|
28
30
|
if payload_name.blank? || payload_name == "SQL" # SQL vs Model Load/Exists
|
|
29
31
|
color(name, ActiveSupport::LogSubscriber::MAGENTA, true)
|
|
@@ -85,7 +87,7 @@ module PpSql
|
|
|
85
87
|
ActiveSupport.on_load(:active_record) do
|
|
86
88
|
ActiveRecord::Relation.send(:prepend, ToSqlBeautify)
|
|
87
89
|
ActiveRecord::LogSubscriber.send(:prepend, LogSubscriberPrettyPrint)
|
|
88
|
-
ActiveRecord::LogSubscriber.send(:include,
|
|
90
|
+
ActiveRecord::LogSubscriber.send(:include, Rails5PpSqlExtraction) if Rails::VERSION::MAJOR <= 4
|
|
89
91
|
end
|
|
90
92
|
end
|
|
91
93
|
end
|