diff --git a/lib/mongoid/tags_arent_hard/tags.rb b/lib/mongoid/tags_arent_hard/tags.rb index 062261d..ed19e70 100644 --- a/lib/mongoid/tags_arent_hard/tags.rb +++ b/lib/mongoid/tags_arent_hard/tags.rb @@ -4,7 +4,7 @@ class Tags attr_accessor :tag_list attr_accessor :options - delegate :join, :map, :each, :inspect, :==, :===, :eql?, :__bson_dump__, :delete, :&, :to_ary, :to_json, to: :tag_list + delegate :join, :map, :each, :inspect, :==, :===, :eql?, :__bson_dump__, :delete, :&, :to_ary, :to_json, :as_json, to: :tag_list def initialize(*tag_list, options) self.options = {separator: Mongoid::TagsArentHard.config.separator}.merge(options) diff --git a/lib/mongoid/tags_arent_hard/version.rb b/lib/mongoid/tags_arent_hard/version.rb index 3a589d3..b2b9022 100644 --- a/lib/mongoid/tags_arent_hard/version.rb +++ b/lib/mongoid/tags_arent_hard/version.rb @@ -2,7 +2,7 @@ module Mongoid module Tags module Arent module Hard - VERSION = "1.0.2" + VERSION = "1.0.3" end end end diff --git a/spec/tags_arent_hard/tags_spec.rb b/spec/tags_arent_hard/tags_spec.rb index 8bf12ae..3345735 100644 --- a/spec/tags_arent_hard/tags_spec.rb +++ b/spec/tags_arent_hard/tags_spec.rb @@ -71,4 +71,12 @@ end + describe 'as_json' do + + it "returns the underlying array" do + tags.as_json.should eql(["foo", "bar", "baz"]) + end + + end + end \ No newline at end of file