freeze_tag 0.1.2 → 0.1.3

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: df73d38aa0054b86cb5ca20c6e4e324102ac4202
4
- data.tar.gz: 592b6a20d9a0b7506f54e84e968be8da76d5d501
3
+ metadata.gz: 47b2394d2f080146b1820559c8ae66fa499e34a1
4
+ data.tar.gz: 502553609b09b02c70f14ee5a5d40c7dc69f3a8b
5
5
  SHA512:
6
- metadata.gz: 4ee8f43b15e13b9c66f4e75e88e032ea53c3cacc46cd6018897401eb42c059aa0449ef268b407a7ccb9d270f7c3a772ccad1150ef5135103479f0fd406bc52e3
7
- data.tar.gz: 4b83637a040414c2982fdaa4c3e0f3beb978b97ff2974d04c461aa4702df8ad6744a57d4077dac8abd1c9fe87eb3431f8342fb0ce15417922019b9c3c4be7da9
6
+ metadata.gz: 4f1b3e6b7e499a196c520c28b2925661d7fbaeca1c342a1069489159f20137c7dc411b0bac90c6f70172ac80cd09b8fab59d5c67b8d17b663423493f3ee0fa49
7
+ data.tar.gz: 24591727e01b8b3ac2a0078f2b522cbe1cf49de18dbbcfd6a37e757e3a84d9bb6988599d94ce928716adf6611dc66311202c894ee3e6001fb001aead61bd03d0
data/README.md CHANGED
@@ -90,6 +90,19 @@ All the same methods above work, simple pass a list as an argument.
90
90
  my_model_instance.freeze_tag(as: "Web Design", list: "Skills")
91
91
  ```
92
92
 
93
+ ##### Tagging while creating:
94
+ You can also use the same style/attributes to tag while creating instances
95
+
96
+ ```ruby
97
+ my_model_instance = MyModel.new(name: "MyModelName", freeze_tagged: [{
98
+ as: ["Cool", "Beans"],
99
+ list: "Ideas",
100
+ expire_others: true
101
+ }])
102
+
103
+ my_model_instance.save
104
+ ```
105
+
93
106
  #### Accessing tags:
94
107
 
95
108
  All the current "active" tags as a simple array of strings.
@@ -5,5 +5,10 @@ module FreezeTag
5
5
  class Tag < ::ActiveRecord::Base
6
6
  self.table_name = "freeze_tags"
7
7
  belongs_to :taggable, polymorphic: true
8
+
9
+ def expired?
10
+ expired_at > DateTime.now
11
+ end
12
+
8
13
  end
9
14
  end
@@ -30,7 +30,7 @@ module FreezeTag
30
30
  end
31
31
 
32
32
  unless as.present?
33
- self.errors.add(:freeze_tags, "Missing Tags")
33
+ self.errors.add(:freeze_tags, "Freeze tag error")
34
34
  return
35
35
  end
36
36
 
@@ -1,3 +1,3 @@
1
1
  module FreezeTag
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freeze_tag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Franzen