better_record 0.22.8 → 0.22.9
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91f13fbd6a8dc65f36431f809f4abbee9e3efb4e1f5463dfe6bfc6da36e9b79b
|
4
|
+
data.tar.gz: 8441806856eacd6c530680d9184c19363bf15b8060e4198ea1f260ebe893d3fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e351916c382db5ca42772ea5ba8034d978bf069caa9338bb3c6785db209ce72722761e15afcbc6d8f0b5bab6ab4ab7e4cbf39f51d3e5cc73f25aa9113e5826bb
|
7
|
+
data.tar.gz: 2c345b65982a8376b0f978ac899d1b8f392fcfecf12bd21aa07d1fef72053dfb196bba3f48b6b0b388e9d44016d1a06039aa4058659a3dc875c2faf5b6716d5e
|
@@ -13,5 +13,20 @@ class String
|
|
13
13
|
self.replace clean_certificate
|
14
14
|
end
|
15
15
|
|
16
|
+
def cleanup
|
17
|
+
dup.gsub!(/\s*(\r?\n\s*|\s+)/, ' ')
|
18
|
+
end
|
19
|
+
|
20
|
+
def cleanup!
|
21
|
+
gsub!(/\s*(\r?\n\s*|\s+)/, ' ')
|
22
|
+
self
|
23
|
+
end
|
24
|
+
|
25
|
+
def cleanup_production
|
26
|
+
Rails.env.production? \
|
27
|
+
? cleanup
|
28
|
+
: self
|
29
|
+
end
|
30
|
+
|
16
31
|
alias_method :clean_cert, :clean_certificate
|
17
32
|
end
|
@@ -94,7 +94,7 @@ $$
|
|
94
94
|
audit_row.client_query = NULL;
|
95
95
|
END IF;
|
96
96
|
|
97
|
-
IF ((TG_ARGV[1] IS NOT NULL) AND (
|
97
|
+
IF ((TG_LEVEL = 'ROW') AND (TG_ARGV[1] IS NOT NULL) AND (TG_ARGV[1]::TEXT <> 'NULL') AND (TG_ARGV[1]::TEXT <> 'null') AND (TG_ARGV[1]::TEXT <> '')) THEN
|
98
98
|
pk_val_query = 'SELECT $1.' || quote_ident(TG_ARGV[1]::text);
|
99
99
|
|
100
100
|
IF (TG_OP IS DISTINCT FROM 'DELETE') THEN
|
@@ -216,7 +216,6 @@ $$
|
|
216
216
|
'LIMIT 1';
|
217
217
|
|
218
218
|
EXECUTE _pk_query_text INTO _pk_column_name;
|
219
|
-
raise notice 'Value %', _pk_column_name;
|
220
219
|
return _pk_column_name;
|
221
220
|
END;
|
222
221
|
$$
|
@@ -99,7 +99,7 @@ module BetterRecord
|
|
99
99
|
def transaction(*args)
|
100
100
|
super(*args) do
|
101
101
|
if BetterRecord::Current.user
|
102
|
-
ActiveRecord::Base.connection.execute <<-SQL
|
102
|
+
ActiveRecord::Base.connection.execute <<-SQL.cleanup_production
|
103
103
|
CREATE TEMP TABLE IF NOT EXISTS
|
104
104
|
"_app_user" (user_id integer, user_type text, ip_address inet);
|
105
105
|
|
@@ -119,7 +119,7 @@ module BetterRecord
|
|
119
119
|
WHERE NOT EXISTS (SELECT * FROM _app_user);
|
120
120
|
SQL
|
121
121
|
else
|
122
|
-
ActiveRecord::Base.connection.execute <<-SQL
|
122
|
+
ActiveRecord::Base.connection.execute <<-SQL.cleanup_production
|
123
123
|
CREATE TEMP TABLE IF NOT EXISTS
|
124
124
|
"_app_user" (user_id integer, user_type text, ip_address inet);
|
125
125
|
SQL
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: better_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.22.
|
4
|
+
version: 0.22.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sampson Crowley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -357,7 +357,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
357
357
|
- !ruby/object:Gem::Version
|
358
358
|
version: '0'
|
359
359
|
requirements: []
|
360
|
-
rubygems_version: 3.0.
|
360
|
+
rubygems_version: 3.0.4
|
361
361
|
signing_key:
|
362
362
|
specification_version: 4
|
363
363
|
summary: Fix functions that are lacking in Active record to be compatible with multi-app
|