gutentag 2.3.2 → 2.4.0
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/CHANGELOG.md +8 -0
- data/README.md +2 -10
- data/app/models/gutentag/tag.rb +3 -0
- data/gutentag.gemspec +1 -1
- data/lib/gutentag.rb +5 -9
- data/lib/gutentag/engine.rb +0 -4
- data/lib/gutentag/tag_validations.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab338132cb66484c650c46037b6c5133b4ee72c90e7397fbf045cb909029bc3c
|
4
|
+
data.tar.gz: 7f4d9166ed7d9ef6a0b44a677f0a182434abcc1ceecfe26ea0ab137714b2c6c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57eaa6e0442287f4a07dfb612cbb2c18dda900fe8cf7b274f12eecd299b70355711ff786ab20bf0616716e0ba7b1dc8520458d90a779c3cc715fa78e7842304a
|
7
|
+
data.tar.gz: 067b316bba0642bfedd777ff8cf7d0d85a08f326fd4959466ca3b831be3496fe9aad93872e16a7c3830f29b2ef8aafba8194628188784aed4d60413951d38c6e
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project (at least, from v0.5.0 onwards) will be documented in this file.
|
4
4
|
|
5
|
+
## 2.4.0 - 2018-05-18
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
|
9
|
+
* Tag validation is now added only when the tag model is loaded, rather than when the app boots. This especially simplifies setup for non-Rails apps ([Michael Grosser](https://github.com/grosser) in [#54](https://github.com/pat/gutentag/pull/54)).
|
10
|
+
* A warning is displayed if the tag model is referenced without a database being present.
|
11
|
+
* Models are now lazily autoloaded for non-Rails apps (when `Rails::Engine` isn't present).
|
12
|
+
|
5
13
|
## 2.3.2 - 2018-04-27
|
6
14
|
|
7
15
|
### Fixed
|
data/README.md
CHANGED
@@ -80,7 +80,7 @@ These are the versions the test suite runs against. It's possible it may work on
|
|
80
80
|
Get it into your Gemfile - and don't forget the version constraint!
|
81
81
|
|
82
82
|
```Ruby
|
83
|
-
gem 'gutentag', '~> 2.
|
83
|
+
gem 'gutentag', '~> 2.4'
|
84
84
|
```
|
85
85
|
|
86
86
|
Next: your tags get persisted to your database, so let's import and run the migrations to get the tables set up:
|
@@ -92,15 +92,7 @@ rake db:migrate
|
|
92
92
|
|
93
93
|
### Without Rails
|
94
94
|
|
95
|
-
If you want to use Gutentag outside of Rails, you can. However, there
|
96
|
-
|
97
|
-
* You'll want to invoke this code once ActiveRecord's connected to the database:
|
98
|
-
|
99
|
-
```ruby
|
100
|
-
ActiveSupport.run_load_hooks :gutentag
|
101
|
-
```
|
102
|
-
|
103
|
-
* And you'll want to set up your database with the same schema (as importing in the migrations isn't possible without Rails). The schema from 0.7.0 onwards is below:
|
95
|
+
If you want to use Gutentag outside of Rails, you can. However, there is one caveat: You'll want to set up your database with the same schema (as importing in the migrations isn't possible without Rails). The schema from 0.7.0 onwards is below:
|
104
96
|
|
105
97
|
```Ruby
|
106
98
|
create_table :gutentag_taggings do |t|
|
data/app/models/gutentag/tag.rb
CHANGED
data/gutentag.gemspec
CHANGED
data/lib/gutentag.rb
CHANGED
@@ -38,17 +38,13 @@ require "gutentag/tagged_with"
|
|
38
38
|
|
39
39
|
Gutentag.dirtier = Gutentag::Dirty if ActiveRecord::VERSION::STRING.to_f < 4.2
|
40
40
|
|
41
|
-
require "active_support/lazy_load_hooks"
|
42
|
-
ActiveSupport.on_load(:gutentag) do
|
43
|
-
require "gutentag/tag_validations"
|
44
|
-
|
45
|
-
Gutentag.tag_validations.call Gutentag::Tag
|
46
|
-
end
|
47
|
-
|
48
41
|
if defined?(Rails::Engine)
|
49
42
|
require "gutentag/engine"
|
50
43
|
else
|
51
44
|
require "active_record"
|
52
|
-
|
53
|
-
|
45
|
+
|
46
|
+
Gutentag.autoload :Tag,
|
47
|
+
File.expand_path("../app/models/gutentag/tag", __dir__)
|
48
|
+
Gutentag.autoload :Tagging,
|
49
|
+
File.expand_path("../app/models/gutentag/tagging", __dir__)
|
54
50
|
end
|
data/lib/gutentag/engine.rb
CHANGED
@@ -37,6 +37,11 @@ class Gutentag::TagValidations
|
|
37
37
|
def add_length_validation?
|
38
38
|
klass.table_exists? && limit.present?
|
39
39
|
rescue *DATABASE_ERROR_CLASSES
|
40
|
+
warn <<-MESSAGE
|
41
|
+
The database is not currently available, and so Gutentag was not able to set
|
42
|
+
up tag validations completely (in particular: adding a length limit to match
|
43
|
+
database constraints).
|
44
|
+
MESSAGE
|
40
45
|
false
|
41
46
|
end
|
42
47
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gutentag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Allan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|