lean_tag 0.1.1 → 0.1.2
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/lib/lean_tag/taggable.rb +2 -4
- data/lib/lean_tag/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2a0c75bde470305b48d2afe443e04a4972f3dc3d
|
|
4
|
+
data.tar.gz: 4ababb77581f5b879a7fedc3bc6c47e203cc6ad1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f115d263e884f5cca2abad2eb5220935f5e45d445733bf5c0b642dee4b18129b7b1ca98fe650f5f1eb353982ef548d1b5b4d31ac3b249fd230149a3f6bee9c3
|
|
7
|
+
data.tar.gz: 43068f0a5f13703ca24a70ff53646b3d335e9e0c9ee187eba4c6acd05a3be8143c62827f62e509063d0a17197e5841f440dd9d6a60652fca3e38b263d5a7f695
|
data/lib/lean_tag/taggable.rb
CHANGED
|
@@ -6,8 +6,6 @@ module LeanTag
|
|
|
6
6
|
has_many :taggings, class_name: "LeanTag::Tagging", as: :record, inverse_of: :record, dependent: :destroy
|
|
7
7
|
has_many :tags, through: :taggings
|
|
8
8
|
|
|
9
|
-
accepts_nested_attributes_for :taggings, allow_destroy: true
|
|
10
|
-
|
|
11
9
|
scope :with_tags, -> { includes(:tags) }
|
|
12
10
|
end
|
|
13
11
|
end
|
|
@@ -57,7 +55,7 @@ module LeanTag
|
|
|
57
55
|
##
|
|
58
56
|
# Finds current tags on this record which aren't in the passed list
|
|
59
57
|
def excluded_tags(tag_names)
|
|
60
|
-
self.
|
|
58
|
+
self.tags.reject { |t| t.name.in?(tag_names) }
|
|
61
59
|
end
|
|
62
60
|
|
|
63
61
|
##
|
|
@@ -69,7 +67,7 @@ module LeanTag
|
|
|
69
67
|
##
|
|
70
68
|
# Finds current tags on this record which are in the passed list
|
|
71
69
|
def included_tags(tag_names)
|
|
72
|
-
self.
|
|
70
|
+
self.tags.select { |t| t.name.in?(tag_names) }
|
|
73
71
|
end
|
|
74
72
|
|
|
75
73
|
##
|
data/lib/lean_tag/version.rb
CHANGED