freeze_tag 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: 47b2394d2f080146b1820559c8ae66fa499e34a1
4
- data.tar.gz: 502553609b09b02c70f14ee5a5d40c7dc69f3a8b
3
+ metadata.gz: 4efe3728e7ca3f3481063a4031f602f2c2f95667
4
+ data.tar.gz: 0d346dfeea75f18484606ca6cf022fb58a8734ed
5
5
  SHA512:
6
- metadata.gz: 4f1b3e6b7e499a196c520c28b2925661d7fbaeca1c342a1069489159f20137c7dc411b0bac90c6f70172ac80cd09b8fab59d5c67b8d17b663423493f3ee0fa49
7
- data.tar.gz: 24591727e01b8b3ac2a0078f2b522cbe1cf49de18dbbcfd6a37e757e3a84d9bb6988599d94ce928716adf6611dc66311202c894ee3e6001fb001aead61bd03d0
6
+ metadata.gz: 17397bdfd51dad209132c32c368a1c89b1ae86db33f202c243a2ac738dc184202f5789f5dd563f500755bf4d9bc59929f593b75dab377400c4bec1541575d022
7
+ data.tar.gz: 59b40f8ba43789c5123224442724ac645e88586a9c440612c33b95b5e0df0b9efe97979f003f1c06721bef69959ba04d3c3cc1891cced787f1ef587bfbbce1c9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- freeze_tag (0.1.2)
4
+ freeze_tag (0.1.3)
5
5
  rails (>= 4.2)
6
6
 
7
7
  GEM
@@ -70,27 +70,27 @@ module FreezeTag
70
70
  def freeze_tagged(as: nil, list: nil)
71
71
  as = as.downcase if self.try(:freeze_tag_case_sensitive)
72
72
  if list.present?
73
- self.joins("INNER JOIN freeze_tags ON freeze_tags.taggable_id = #{self.table_name}.id AND (freeze_tags.expired_at IS NULL OR freeze_tags.expired_at > '#{DateTime.now}') AND freeze_tags.tag = '#{as}' AND freeze_tags.list = '#{list}'")
73
+ self.joins("INNER JOIN freeze_tags ON freeze_tags.taggable_id = #{self.table_name}.id AND (freeze_tags.expired_at IS NULL OR freeze_tags.expired_at > '#{DateTime.now}') AND freeze_tags.tag = '#{as}' AND freeze_tags.list = '#{list}'").distinct
74
74
  else
75
- self.joins("INNER JOIN freeze_tags ON freeze_tags.taggable_id = #{self.table_name}.id AND (freeze_tags.expired_at IS NULL OR freeze_tags.expired_at > '#{DateTime.now}') AND freeze_tags.tag = '#{as}'")
75
+ self.joins("INNER JOIN freeze_tags ON freeze_tags.taggable_id = #{self.table_name}.id AND (freeze_tags.expired_at IS NULL OR freeze_tags.expired_at > '#{DateTime.now}') AND freeze_tags.tag = '#{as}'").distinct
76
76
  end
77
77
  end
78
78
 
79
79
  def previously_freeze_tagged(as: nil, list: nil)
80
80
  as = as.downcase if self.try(:freeze_tag_case_sensitive)
81
81
  if list.present?
82
- self.joins("INNER JOIN freeze_tags ON freeze_tags.taggable_id = #{self.table_name}.id AND freeze_tags.expired_at < '#{DateTime.now}' AND freeze_tags.tag = '#{as}' AND freeze_tags.list = '#{list}'")
82
+ self.joins("INNER JOIN freeze_tags ON freeze_tags.taggable_id = #{self.table_name}.id AND freeze_tags.expired_at < '#{DateTime.now}' AND freeze_tags.tag = '#{as}' AND freeze_tags.list = '#{list}'").distinct
83
83
  else
84
- self.joins("INNER JOIN freeze_tags ON freeze_tags.taggable_id = #{self.table_name}.id AND freeze_tags.expired_at < '#{DateTime.now}' AND freeze_tags.tag = '#{as}'")
84
+ self.joins("INNER JOIN freeze_tags ON freeze_tags.taggable_id = #{self.table_name}.id AND freeze_tags.expired_at < '#{DateTime.now}' AND freeze_tags.tag = '#{as}'").distinct
85
85
  end
86
86
  end
87
87
 
88
88
  def ever_freeze_tagged(as: nil, list: nil)
89
89
  as = as.downcase if self.try(:freeze_tag_case_sensitive)
90
90
  if list.present?
91
- self.joins("INNER JOIN freeze_tags ON freeze_tags.taggable_id = #{self.table_name}.id AND freeze_tags.tag = '#{as}' AND freeze_tags.list = '#{list}'")
91
+ self.joins("INNER JOIN freeze_tags ON freeze_tags.taggable_id = #{self.table_name}.id AND freeze_tags.tag = '#{as}' AND freeze_tags.list = '#{list}'").distinct
92
92
  else
93
- self.joins("INNER JOIN freeze_tags ON freeze_tags.taggable_id = #{self.table_name}.id AND freeze_tags.tag = '#{as}'")
93
+ self.joins("INNER JOIN freeze_tags ON freeze_tags.taggable_id = #{self.table_name}.id AND freeze_tags.tag = '#{as}'").distinct
94
94
  end
95
95
  end
96
96
  end
@@ -1,3 +1,3 @@
1
1
  module FreezeTag
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freeze_tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Franzen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-13 00:00:00.000000000 Z
11
+ date: 2018-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails