Skip to content

Commit

Permalink
Fixed README and gemspec
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankroes committed Oct 24, 2010
1 parent 34a13a9 commit 648a79c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 7 additions & 2 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Most current tree plugins use a parent_id column (has_ancestry, awesome_nested_s

I don't see any way Ancestry tree integrity could get compromised without explicitly setting cyclic parents or invalid ancestry and circumventing validation with update_attribute, if you do, please let me know.

Ancestry includes some methods for detecting integrity problems and restoring integrity just to be sure. To check integrity use: [Model].check_ancestry_integrity!. An AncestryIntegrityException will be raised if there are any problems. To restore integrity use: [Model].restore_ancestry_integrity!.
Ancestry includes some methods for detecting integrity problems and restoring integrity just to be sure. To check integrity use: [Model].check_ancestry_integrity!. An AncestryIntegrityException will be raised if there are any problems. You can also specify :report => :list to return an array of exceptions or :report => :echo to echo any error messages. To restore integrity use: [Model].restore_ancestry_integrity!.

For example, from IRB:

Expand All @@ -215,7 +215,7 @@ Additionally, if you think something is wrong with your depth cache:

= Tests

The Ancestry gem comes with a unit test suite consisting of about 1800 assertions in about 30 tests. It takes about 10 seconds to run on sqlite. To run it yourself, install Ancestry as a plugin into a Rails application, go to the ancestry folder and type 'rake'. The test suite is located in 'test/has_ancestry_test.rb'.
The Ancestry gem comes with a unit test suite consisting of about 1800 assertions in about 30 tests. It takes about 10 seconds to run on sqlite. To run it yourself check out the repository from GitHub, copy test/database.example.yml to test/database.yml and type 'rake'. You can pass rake style options for ActiveRecord version to test against (e.g. ar=3.0.1) and database to test against (e.g. db=mysql). The test suite is located in test/has_ancestry_test.rb.

= Internals

Expand All @@ -229,6 +229,11 @@ The materialised path pattern requires Ancestry to use a 'like' condition in ord

The latest and recommended version of ancestry is 1.2.0. The three numbers of each version numbers are respectively the major, minor and patch versions. We started with major version 1 because it looks so much better and ancestry was already quite mature and complete when it was published. The major version is only bumped when backwards compatibility is broken. The minor version is bumped when new features are added. The patch version is bumped when bugs are fixed.

- Version 1.2.1 (2010-10-24)
- Fixed all deprecation warnings for rails 3.0.X
- Added :report option to check_ancestry_integrity!
- Changed ActiveRecord dependency to 2.2.2
- Tested and fixed for ruby 1.8.7 and 1.9.2
- Version 1.2.0 (2009-11-07)
- Removed some duplication in has_ancestry
- Cleaned up plugin pattern according to http://yehudakatz.com/2009/11/12/better-ruby-idioms/
Expand Down
8 changes: 3 additions & 5 deletions ancestry.gemspec
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
require 'rake'

Gem::Specification.new do |s|
s.name = 'ancestry'
s.description = 'Organise ActiveRecord model into a tree structure'
s.summary = 'Ancestry allows the records of a ActiveRecord model to be organised in a tree structure, using a single, intuitively formatted database column. It exposes all the standard tree structure relations (ancestors, parent, root, children, siblings, descendants) and all of them can be fetched in a single sql query. Additional features are named_scopes, integrity checking, integrity restoration, arrangement of (sub)tree into hashes and different strategies for dealing with orphaned records.'

s.version = '1.3.0'
s.version = '1.2.1'
s.date = '2010-01-27'

s.author = 'Stefan Kroes'
s.email = '[email protected]'
s.homepage = 'http://github.com/stefankroes/ancestry'

s.files = FileList[
s.files = [
'ancestry.gemspec',
'init.rb',
'install.rb',
Expand All @@ -25,5 +23,5 @@ Gem::Specification.new do |s|
'README.rdoc'
]

s.add_dependency 'activerecord', '>= 2.1.0'
s.add_dependency 'activerecord', '>= 2.2.2'
end

0 comments on commit 648a79c

Please sign in to comment.