easy_tags 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/easy_tags/taggable_context.rb +39 -1
- data/lib/easy_tags/taggable_context_methods.rb +1 -1
- data/lib/easy_tags/version.rb +1 -1
- 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: 8a7f8eff9a1c48c2acd73b9e1508a60dd109e1093bc3d1907ac9d59ce84d1e6c
|
4
|
+
data.tar.gz: ee07bbd270d6430cf8282cb55a081567983c48eeda35c43dc42ed5850f8e4957
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '029a2218a20846732ad35ad4ee9801f242933624fa49dea7eb8ebd524c07c5bb477a83ff99fba5cae7aebb14bbac538b525e3ebfddcd02d6c43624d46d87d830'
|
7
|
+
data.tar.gz: 172a6b5c1af8643153b582e2bf04a3b3245214eea0f06ad52b7582099c11b0d11f815ab11679cf2f6a110571fcf791ec0e7a55eb601868a6c9a474aca784104d
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.2.1] - 2019-10-24
|
10
|
+
### Fixed
|
11
|
+
- Fix `.add` and `.remove` methods not implementing properly dirty behavior
|
12
|
+
|
9
13
|
## [0.2.0] - 2019-09-12
|
10
14
|
### Added
|
11
15
|
- `[context]_list_persisted` interface method for accessing persisted/previous tag list string
|
@@ -14,5 +18,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
14
18
|
Initial release
|
15
19
|
|
16
20
|
[Unreleased]: https://github.com/iiwo/easy_tagscompare/v0.2.0...HEAD
|
21
|
+
[0.2.1]: https://github.com/iiwo/easy_tags/compare/v0.2.0...v0.2.1
|
17
22
|
[0.2.0]: https://github.com/iiwo/easy_tags/compare/v0.1.0...v0.2.0
|
18
23
|
[0.1.0]: https://github.com/iiwo/easy_tags/releases/tag/v0.1.0
|
@@ -30,7 +30,7 @@ module EasyTags
|
|
30
30
|
def update(value)
|
31
31
|
@tags = TagList.new(value)
|
32
32
|
|
33
|
-
|
33
|
+
notify_change
|
34
34
|
end
|
35
35
|
|
36
36
|
# @return [TagList]
|
@@ -49,8 +49,46 @@ module EasyTags
|
|
49
49
|
@persisted_tags = nil
|
50
50
|
end
|
51
51
|
|
52
|
+
# Add tags to the tag_list. Duplicate or blank tags will be ignored.
|
53
|
+
#
|
54
|
+
# Example:
|
55
|
+
# tag_list.add('Fun', 'Happy')
|
56
|
+
def add(*names)
|
57
|
+
tags.add(*names).tap do
|
58
|
+
notify_change
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Remove item from list
|
63
|
+
#
|
64
|
+
# Example:
|
65
|
+
# tag_list.remove('Issues')
|
66
|
+
def remove(value)
|
67
|
+
tags.remove(value).tap do
|
68
|
+
notify_change
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def ==(other)
|
73
|
+
to_a == other.to_a
|
74
|
+
end
|
75
|
+
|
52
76
|
private
|
53
77
|
|
54
78
|
attr_accessor :context, :refresh_persisted_tags, :on_change
|
79
|
+
|
80
|
+
def respond_to_missing?(name, _include_private = false)
|
81
|
+
tags.respond_to?(name)
|
82
|
+
end
|
83
|
+
|
84
|
+
def method_missing(name, *args, &block)
|
85
|
+
return super unless respond_to_missing?(name)
|
86
|
+
|
87
|
+
tags.send(name, *args, &block)
|
88
|
+
end
|
89
|
+
|
90
|
+
def notify_change
|
91
|
+
on_change.call(self) if changed?
|
92
|
+
end
|
55
93
|
end
|
56
94
|
end
|
data/lib/easy_tags/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_tags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iwo Dziechciarow
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|