paper_trail 8.1.1 → 8.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 389976a20a0d3d80ff31006b9ad5f58e8c66b2678d96eb6bdf25d461d28dc182
4
- data.tar.gz: 0d7a51d9715a65cd7a0f509d9db888a8b6b01514c9f6a56bd13940fced350361
3
+ metadata.gz: a4d9e6729cf3633953e38a14daf62fbd663938de52a1d495cdcbc5b3b63a12c2
4
+ data.tar.gz: c12f82f3b75a454cfd55b389923859fe799128430f6eb541fb93e10b2dd00454
5
5
  SHA512:
6
- metadata.gz: 26239968c3d59c0a745d66990d053f2ca9a03bce8dfd31bbd4d811abcb05e58cad0fa1cf7d4ac7882325861e07edacb295b24c34ae29f7b880d23bff9ba718bc
7
- data.tar.gz: d6c8b8104f81dfd31ecb64cc4ec936fb22d3b079ac686628f36e3c770c6f768d1953a47c195f11587ffd9e2afc840616364bf89f5893ea93e6dbd1cdf6064697
6
+ metadata.gz: 14b592477bc7292c66c1791e0762e62b1a817ece28d44f5156f7c7242fb18e62b93ebbd92b0efd7172538184bae2aa0c9c914b59e3378b15b043748eefa1f340
7
+ data.tar.gz: b5b5352145cbb72c796234d4761a69141de72cb0ecd74f914b7082e318ea868185cabfee3df3f91d7c0f5f7ccad23e2d4cb3495f89c26500d5dd390a03131f11
@@ -37,7 +37,7 @@ module PaperTrail
37
37
  # @api private
38
38
  def load_version(assoc, id, transaction_id, version_at)
39
39
  assoc.klass.paper_trail.version_class.
40
- where("item_type = ?", assoc.klass.name).
40
+ where("item_type = ?", assoc.klass.base_class.name).
41
41
  where("item_id = ?", id).
42
42
  where("created_at >= ? OR transaction_id = ?", version_at, transaction_id).
43
43
  order("id").limit(1).first
@@ -37,7 +37,7 @@ module PaperTrail
37
37
  # @api private
38
38
  def load_version(assoc, id, transaction_id, version_at)
39
39
  assoc.klass.paper_trail.version_class.
40
- where("item_type = ?", assoc.klass.name).
40
+ where("item_type = ?", assoc.klass.base_class.name).
41
41
  where("item_id = ?", id).
42
42
  where("created_at >= ? OR transaction_id = ?", version_at, transaction_id).
43
43
  order("id").
@@ -98,7 +98,7 @@ module PaperTrail
98
98
  select("MIN(version_id)").
99
99
  where("foreign_key_name = ?", assoc.foreign_key).
100
100
  where("foreign_key_id = ?", model.id).
101
- where("#{version_table}.item_type = ?", assoc.klass.name).
101
+ where("#{version_table}.item_type = ?", assoc.klass.base_class.name).
102
102
  where("created_at >= ? OR transaction_id = ?", version_at, tx_id).
103
103
  group("item_id").
104
104
  to_sql
@@ -73,7 +73,7 @@ module PaperTrail
73
73
  def load_versions_for_hmt_association(assoc, ids, tx_id, version_at)
74
74
  version_id_subquery = assoc.klass.paper_trail.version_class.
75
75
  select("MIN(id)").
76
- where("item_type = ?", assoc.klass.name).
76
+ where("item_type = ?", assoc.klass.base_class.name).
77
77
  where("item_id IN (?)", ids).
78
78
  where(
79
79
  "created_at >= ? OR transaction_id = ?",
@@ -36,7 +36,7 @@ module PaperTrail
36
36
  model.class.paper_trail.version_class.joins(:version_associations).
37
37
  where("version_associations.foreign_key_name = ?", assoc.foreign_key).
38
38
  where("version_associations.foreign_key_id = ?", model.id).
39
- where("#{version_table_name}.item_type = ?", assoc.klass.name).
39
+ where("#{version_table_name}.item_type = ?", assoc.klass.base_class.name).
40
40
  where("created_at >= ? OR transaction_id = ?", version_at, transaction_id).
41
41
  order("#{version_table_name}.id ASC").
42
42
  first
@@ -7,7 +7,7 @@ module PaperTrail
7
7
  module VERSION
8
8
  MAJOR = 8
9
9
  MINOR = 1
10
- TINY = 1
10
+ TINY = 2
11
11
  PRE = nil
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".").freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paper_trail
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.1
4
+ version: 8.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Stewart
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-12-11 00:00:00.000000000 Z
13
+ date: 2017-12-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord