mongoid-tags-arent-hard 1.1.2 → 1.1.3

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.
data/README.md CHANGED
@@ -107,4 +107,5 @@ Again, notice that you can use either a string, an array, or a splatted list as
107
107
  * Mark Bates
108
108
  * Carsten Block
109
109
  * Luke Bergen
110
- * Laurent Arnoud
110
+ * Laurent Arnoud
111
+ * thomas morgan
@@ -1,6 +1,7 @@
1
1
  module Mongoid
2
2
  module TagsArentHard
3
3
  class Tags < BasicObject
4
+ extend ::Origin::Extensions::Array::ClassMethods
4
5
 
5
6
  attr_accessor :tag_list
6
7
  attr_accessor :options
@@ -63,6 +64,14 @@ module Mongoid
63
64
  !self.==(other)
64
65
  end
65
66
 
67
+ def self.mongoize(object)
68
+ evolve(object)
69
+ end
70
+
71
+ def self.demongoize(object)
72
+ object
73
+ end
74
+
66
75
  end
67
76
  end
68
77
  end
@@ -9,7 +9,7 @@ module Mongoid
9
9
 
10
10
  def taggable_with(name, options = {})
11
11
  options = {separator: Mongoid::TagsArentHard.config.separator, _name: name}.merge(options)
12
- self.field(name, type: Array, default: [])
12
+ self.field(name, type: Mongoid::TagsArentHard::Tags, default: Mongoid::TagsArentHard::Tags.new([], options))
13
13
  self.class_eval do
14
14
  define_method(name) do
15
15
  val = super()
@@ -2,7 +2,7 @@ module Mongoid
2
2
  module Tags
3
3
  module Arent
4
4
  module Hard
5
- VERSION = "1.1.2"
5
+ VERSION = "1.1.3"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-tags-arent-hard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-08 00:00:00.000000000 Z
12
+ date: 2013-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongoid