fast_versioning 0.2.0 → 0.3.0

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
- SHA256:
3
- metadata.gz: 87613fb753cc329fe499c239bc0a84ce505879abb87c4c74cff07c657b0b86db
4
- data.tar.gz: 7dec724f5f187384c874ff7af8bd4751054d5462e0e2233d94dfc03075f5e3f7
2
+ SHA1:
3
+ metadata.gz: bd85a59cdbdfc4a3b3442f9264a7e392f6ede625
4
+ data.tar.gz: 21ecb716018e323c0ed058484ef1c3047c2c3523
5
5
  SHA512:
6
- metadata.gz: 9b635ba136aed6ec8b8ef573a4e8d958826ff5d481a83fc75f1dddee18d706b6b8909a3b323d1e3db18bf6042f7e4cda7c03ad770848a22147ee19a7e982f8b1
7
- data.tar.gz: 8a2ca6a9207836d1f54feaa6ffddfd86a3583493b00aad0897eb3a25f321e47752892f84b68e7298e96247d944b6c389f1c4742ce04fe4ef2b530b511f143f88
6
+ metadata.gz: 779cb852220635fe14d5a144b12160fd4fb5c1fcfe4637f0b541a927a3a5b49ebb190f2025140c6ee256e9e52e52bbf8a0993fe3949d9f6fe5edf5ecfd3cb13d
7
+ data.tar.gz: 8f78d5c1908fb7e29ec7bb78574a6b3044353a6c162b9ce1b4199f3caa2d5788246766e60d3879668a0a08bcd0292b8927999f4f21969f64b510c956abb79e60
data/README.md CHANGED
@@ -83,6 +83,14 @@ Example usage:
83
83
 
84
84
  # query
85
85
  your_model.fast_versions_for(:status).where(value: 'active').where(prev_value: 'incomplete')
86
+
87
+ # alternatively:
88
+ FastVersioning::FastVersion.find_by(
89
+ item_type: 'ItemType',
90
+ name: 'name',
91
+ value: 'value'
92
+ prev_value: 'prev_value'
93
+ )
86
94
  ```
87
95
 
88
- An [Arcadia Power](http://www.arcadiapower.com) Project
96
+ An [Arcadia Power](http://www.arcadiapower.com) Project
@@ -4,8 +4,6 @@ module FastVersioning
4
4
  belongs_to :whodunnit, polymorphic: true
5
5
  belongs_to :version, class_name: 'PaperTrail::Version'
6
6
 
7
- validates :version_id, uniqueness: { scope: :name }
8
-
9
7
  serialize :meta, JSON
10
8
  end
11
9
  end
@@ -0,0 +1,7 @@
1
+ class AddUniqueIndexToVersionIdName < ActiveRecord::Migration[5.0]
2
+ disable_ddl_transaction!
3
+
4
+ def change
5
+ add_index :fast_versioning_fast_versions, %i[version_id name], unique: true, algorithm: :concurrently
6
+ end
7
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_versioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arcadia Power
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-01-30 00:00:00.000000000 Z
13
+ date: 2019-05-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: sqlite3
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 1.3.13
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 1.3.13
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec-rails
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -91,6 +91,7 @@ files:
91
91
  - Rakefile
92
92
  - app/models/fast_versioning/fast_version.rb
93
93
  - db/migrate/20160914161314_create_fast_versioning_fast_versions.rb
94
+ - db/migrate/20190514134359_add_unique_index_to_version_id_name.rb
94
95
  - lib/fast_versioning.rb
95
96
  - lib/fast_versioning/engine.rb
96
97
  - lib/fast_versioning/fast_versioned.rb
@@ -117,7 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
118
  - !ruby/object:Gem::Version
118
119
  version: '0'
119
120
  requirements: []
120
- rubygems_version: 3.0.2
121
+ rubyforge_project:
122
+ rubygems_version: 2.6.14
121
123
  signing_key:
122
124
  specification_version: 4
123
125
  summary: Fast versioning extension for paper_trail