mongoid-tag-collectible 0.2.0 → 0.2.1

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: f9915b934fae0ee5810a6d72b8106bd55dd29691
4
- data.tar.gz: 72e63db41368654708207f18379b8bf1d0ce32ef
3
+ metadata.gz: 526e18530a711576751aa96f32d48281c65dc9ad
4
+ data.tar.gz: 57302860972306b2e9a696095195133efe2b6fe1
5
5
  SHA512:
6
- metadata.gz: 0eda709bc5c84620606a643fcfea7e0747bbb5f4ffa3274864b6e79ad8907420831bf24fe84e0664c83ab176058fea1fe28de333be3780fbe5686da73da1424a
7
- data.tar.gz: b36152f22e637be6508e260b02e9ac43482a1292c5d7b37058fbd2019cc0d7313dc6793a809f489fd3f88c201b775f6299b5131c8741b139d6b62566186ac1f9
6
+ metadata.gz: 5ca46690df231dac9472dc8e365b9c0b3165778f38c2885a95381a56cfad3ee584e497608ea8420df97c928f41b0c4162a49a12ad0992241d92646483c661444
7
+ data.tar.gz: 06988ab5bae3adb354bf2c67e96fdf0e5eeb4d204d00e426855b31c95c45c176523604a8186725bc69581f44fa9645dc41cef74a6c932484c889364fbc429788
@@ -1,3 +1,7 @@
1
+ ### 0.2.1 (Next)
2
+
3
+ * Fix: support for namespaced classes with name repeated in module name - [@dblock](https://github.com/dblock).
4
+
1
5
  ### 0.2.0 (08/12/2015)
2
6
 
3
7
  * Implemented RuboCop, Ruby-style linter - [@dblock](https://github.com/dblock).
@@ -17,7 +17,8 @@ module Mongoid
17
17
  end
18
18
  klass.tagged_class = self
19
19
  klass.store_in collection: "#{name.underscore.gsub('/', '_')}_tags"
20
- mod_name = "::#{name}".gsub("::#{name.demodulize}", '')
20
+ parts = name.split('::')
21
+ mod_name = parts[0..-2].join('::')
21
22
  mod_name = 'Object' if mod_name.blank?
22
23
  mod_name.constantize.const_set "#{name}Tag".demodulize, klass
23
24
  self.tag_class = "#{name}Tag".constantize
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module TagCollectible
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
@@ -1,10 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Mongoid::TagCollectible::Tagged do
4
- let(:instance) { Namespaced::TestTagged.create! }
4
+ let(:instance) { TestTaggedNamespace::TestTagged.create! }
5
5
  describe 'tag_class' do
6
6
  it 'defines tag_class' do
7
- expect(instance.class.tag_class).to eq(Namespaced::TestTaggedTag)
7
+ expect(instance.class.tag_class).to eq(TestTaggedNamespace::TestTaggedTag)
8
8
  end
9
9
  end
10
10
  describe 'rename_tag' do
@@ -1,4 +1,4 @@
1
- module Namespaced
1
+ module TestTaggedNamespace
2
2
  class TestTagged
3
3
  include Mongoid::Document
4
4
  include Mongoid::Timestamps
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-tag-collectible
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine