mongoid-ancestry 0.4.1 → 0.4.2

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: e5dd4b66b2d758be42f58f57412a652098de6392
4
- data.tar.gz: 24d70be814ae5d82975545e1393de6ca64356b12
3
+ metadata.gz: 874d735ff7aad0729f7436b2a93e92b4f6b175ca
4
+ data.tar.gz: cc44d718b74d884a4d40db2e311bc108ed777288
5
5
  SHA512:
6
- metadata.gz: 8c8f034b7ab0c2755c6d378d92ef95346521882b67b1e82d945b6b73c443bfd9be5cf592de171bd41b467afee42923409375a0b721b6b22d772b4ae4e423805f
7
- data.tar.gz: e342462b06db5cbf37358d3262ddfc240e515eb2cf44e38ade3818d4d591fce7752aeb5ef4e7fe0baad6ecfc2efb1fc4ee909aee2795b3b75be4b635b6855fb8
6
+ metadata.gz: 27cae01753bc6f639df487bd4b2b4341680d8a668108b3c00290e0e00324c894a4bfc7859cee5e6b773452ed74f80abacfe48e932d1e5283f86f80908f351b31
7
+ data.tar.gz: 87e5dd56e393895a3098bb4159786b83a238c764584e244e699e9ef67404cac81b5508ce5380ef90914ccca202435ce9876f7c03a0de564db4c6e4ded2b9b5d4
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Mongoid-ancestry
2
2
  ================
3
3
 
4
- [![travis](https://secure.travis-ci.org/joe1chen/mongoid-ancestry.png)](http://travis-ci.org/joe1chen/mongoid-ancestry)
4
+ [![travis](https://secure.travis-ci.org/skyeagle/mongoid-ancestry.png)](http://travis-ci.org/skyeagle/mongoid-ancestry)
5
5
 
6
6
  Mongoid-ancestry is a gem/plugin that allows the records of a Ruby on Rails Mongoid model to be organised as a tree structure (or hierarchy). It uses a single, intuitively formatted database column, using a variation on the materialised path pattern. It exposes all the standard tree structure relations (ancestors, parent, root, children, siblings, descendants) and all of them can be fetched in a single query. Additional features are STI support, scopes, depth caching, depth constraints, easy migration from older plugins/gems, integrity checking, integrity restoration, arrangement of (sub)tree into hashes and different strategies for dealing with orphaned records.
7
7
 
@@ -34,8 +34,8 @@ module Mongoid
34
34
  self.orphan_strategy = opts[:orphan_strategy]
35
35
 
36
36
  # Create touch accessor and set to option or default
37
- cattr_accessor :touchable
38
- self.touchable = opts[:touchable]
37
+ cattr_accessor :ancestry_touchable
38
+ self.ancestry_touchable = opts[:touchable]
39
39
 
40
40
  # Validate format of ancestry column value
41
41
  primary_key_format = opts[:primary_key_format] || /[a-z0-9]+/
@@ -78,7 +78,7 @@ module Mongoid
78
78
  before_save :update_descendants_with_new_ancestry
79
79
 
80
80
  before_save :touch_parent, if: ->(obj) {
81
- obj.touchable && obj.send(:"#{self.class.ancestry_field}_changed?")
81
+ obj.ancestry_touchable && obj.send(:"#{self.class.ancestry_field}_changed?")
82
82
  }
83
83
 
84
84
  # Apply orphan strategy before destroy
@@ -3,6 +3,6 @@ module Mongoid
3
3
 
4
4
 
5
5
  module Ancestry
6
- VERSION = '0.4.1'
6
+ VERSION = '0.4.2'
7
7
  end
8
8
  end
@@ -36,13 +36,13 @@ describe MongoidAncestry do
36
36
 
37
37
  it "should have default touchable value" do
38
38
  subject.with_model do |model|
39
- model.touchable.should be_false
39
+ model.ancestry_touchable.should be_false
40
40
  end
41
41
  end
42
42
 
43
43
  it "should set touchable value" do
44
44
  subject.with_model touchable: true do |model|
45
- model.touchable.should be_true
45
+ model.ancestry_touchable.should be_true
46
46
  end
47
47
  end
48
48
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-ancestry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kroes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-28 00:00:00.000000000 Z
12
+ date: 2014-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake