Commit Graph

486 Commits

Author SHA1 Message Date
Keenan Brock 4d12cf77a3 ignoring bundle directory 2020-08-03 18:15:57 -04:00
Keenan Brock 2ea838fc6f Version 3.1.0 changelog 2020-08-03 18:15:57 -04:00
Keenan Brock fb41763af3
Merge pull request #491 from d-m-u/remove_broken_hyperlink
remove broken hyperlink in readme
2020-07-28 09:16:27 -04:00
Keenan Brock 1a8e3bf8f0
Merge pull request #490 from d-m-u/mysql_order_simplify
simplify mysql ordering
2020-07-28 02:06:29 -04:00
d-m-u e5a45bdca9 simplify mysql ordering 2020-07-19 14:49:46 -04:00
d-m-u e15c06470a remove link cause it 404's 2020-07-15 21:01:38 -04:00
Keenan Brock 602a9e9d41
Merge pull request #487 from mkllnk/model-name
Better humanise model name for error message
2020-07-14 15:36:43 -04:00
Maikel Linke 129c27b12f
Better humanise model name for error message 2020-07-09 16:47:11 +10:00
Keenan Brock d7cfe4e4eb
Merge pull request #478 from d-m-u/patch-1
Update README.md
2020-06-14 23:52:56 -04:00
d-m-u 48008258aa Update README.md
various nitpicky wording things

sorry but again not quite that sorry

i swear this was the end of things i had issues with in the readme at least
2020-06-13 00:49:42 -04:00
Keenan Brock f5e567c123
Merge pull request #479 from d-m-u/patch-2
Update README.md
2020-06-09 16:39:15 -04:00
d-m-u c28923960c
Update README.md
witch => which

sorry but I had do
2020-06-09 12:00:08 -04:00
Keenan Brock d92fc25624
Merge pull request #477 from kbrock/populate_parent_id
migrate from a non "parent_id" parent column
2020-05-27 19:36:45 -04:00
Keenan Brock 7ae7d45722 migrate from a non "parent_id" parent column
Fixes: #473
2020-05-27 18:43:09 -04:00
Keenan Brock 98c47da4be
Merge pull request #476 from mmoll/travis_pg
Fix DB detection for Travis build
2020-04-30 13:12:43 -04:00
Michael Moll 059023dc10 Fix DB detection for Travis build 2020-04-23 21:01:23 +02:00
Keenan Brock 741042f40b
Merge pull request #475 from yagudaev/patch-1
Update readme instructions for migration
2020-02-28 20:22:44 -05:00
Michael Yagudaev ea69cca6b0
Update outdated rails console insturction
Update the outdated `./script` directory which is no longer part of rails, to simply run rails console.
2020-02-24 14:49:29 -08:00
Keenan Brock 5f11226424
Merge pull request #472 from kbrock/setter_tests
test setting parent and parent_id set the other
2019-12-26 18:32:17 -05:00
Keenan Brock a4fec48635 test setting parent and parent_id set the other 2019-12-12 15:44:02 -05:00
Keenan Brock 07340aeb1b
Merge pull request #462 from dtamai/visual-doc
Add graph examples in documentation
2019-10-02 19:46:57 -04:00
Keenan Brock 02720f46bc
Merge pull request #463 from dtamai/add-indirects-navigation-tests
Add tests for indirects in TreeNavigationTest
2019-10-02 19:12:49 -04:00
Daniel Tamai c4aea62750 Add tests for indirects in TreeNavigationTest 2019-10-01 22:14:07 -03:00
Daniel Tamai 27c0d12adb Add graph examples in documentation 2019-10-01 20:17:21 -03:00
Keenan Brock cebffcaec1
Merge pull request #460 from kbrock/update-update_attribute
test fixes
2019-09-11 11:13:37 -04:00
Keenan Brock 661881a5f1 test around cache counter
I was going to change the way changed used the column name
in the update_cache_counter code. (the purpose of this branch)

Decided to roll that change back, but this test still looks good
2019-09-11 11:08:14 -04:00
Keenan Brock b810976185 use ancestor_ids in test
going towards using ancestor_ids and getting away from using
ancestry_column.
2019-09-11 10:11:47 -04:00
Keenan Brock 188f7bda18
Merge pull request #459 from kbrock/delimiter_definition
Delimiter definition
2019-09-10 22:33:50 -04:00
Keenan Brock bc679817b6 consolidate ActiveRecord 'was' constants 2019-09-10 22:20:15 -04:00
Keenan Brock 758e27b9b9 remove unused path_ids
sorry - I had suggested this to dmu, but it was not used
2019-09-10 22:17:50 -04:00
Keenan Brock 0bf2bb2bd2 Use DELIMITER constant in materialized path 2019-09-10 22:17:44 -04:00
Keenan Brock 3620c0e3df
Merge pull request #458 from kbrock/ancestor_ids_2
Update ancestor_ids not ancestor_column
2019-09-10 17:16:38 -04:00
Keenan Brock f943e4a426 Update ancestor_ids not ancestor_column
all but one reference are updating the ancestor_ids column

This is a moot point to be honest, behind the scenes, it is just
updating the ancestors field in the database, but this gives us
some indirection so we can change the ancestor encoding scheme
2019-09-10 10:51:20 -04:00
Keenan Brock e7b2283184
Merge pull request #455 from kbrock/unconditional
Move conditionals to MaterializedPath
2019-09-09 21:21:19 -04:00
Keenan Brock b0d44767aa
Merge pull request #263 from kbrock/create-child-in-after-callback-2
Fix creating children in after_* callbacks
2019-09-09 16:54:25 -04:00
Jason Stirk f94b22ba1b Fix creating children in after_* callbacks
Previously creating children in an after_* callback would cause the
child's ancestry column to contain just the parent id and not the entire
ancestry path.

A workaround was to call self.reload in the after_* callback, but this
commit makes the process work automatically.

The main issue looked to be that the child_ancestry method was using the
ancestry path before the save (using _was) which for new records was
obviously blank.

This revision uses the current value of the parent's ancestry, and adds
a child_ancestry_was method to return the old behaviour (with a more
descriptive name).

The change to update_descendants_with_new_ancestry was due to it relying
on the old behaviour. The revised version explicitly replaces the old
parent ancestry snippet (using child_ancestry_was) with the new one
path.

REVISED for 2.1.x version of ancestry
2019-09-09 16:50:23 -04:00
Keenan Brock beea5b75af move general scopes to materialized path
removing conditions methods

instead, directly implementing the methods.

descendant_conditions is still hanging around for a little bit
2019-09-09 16:47:13 -04:00
Keenan Brock 3f0b4cd0bf use class scopes instead of instance conditions
This logic is currently a redirect to the class level condition methods
anyway. So removing the indirection and just calling the class
methods directly

The class methods are defined by the scheme (e.g.: materialized path)

unscoped is making descendant_conditions tricky to remove
2019-09-09 16:47:13 -04:00
Keenan Brock b9393f1907
Merge pull request #457 from kbrock/parent_id
call parent id parent_id
2019-09-09 16:44:04 -04:00
Keenan Brock 54a4047595 call parent id parent_id
`parent` used to hold the node's `parent`. so it was called `parent`.

But now it holds the parent id.
So this PR renames the variable to ... `parent_id`

This section of code is too complicated to add the extra cognitive load
and have a confusing variable name

thanks @nicklamuro
2019-09-09 16:42:34 -04:00
Keenan Brock ab7d7590cd
Merge pull request #456 from kbrock/was_was_before_save
Stop using was
2019-09-09 16:35:52 -04:00
Keenan Brock a2597ba6ee proper use of path_ids_was 2019-09-09 16:30:59 -04:00
Keenan Brock e926876df5 make update_descendant more readable 2019-09-09 16:17:37 -04:00
Keenan Brock b449ed360d
Merge pull request #453 from d-m-u/object_creation_performance_enhancements
Performance enhancements for minimizing object creation
2019-09-08 17:04:14 -04:00
d-m-u 44e6a2313c
performance enhancements for minimizing object creation 2019-09-07 18:50:57 -04:00
Keenan Brock 3e333879bc
Merge pull request #452 from kbrock/nil_parent
tests to ensure parent.children.create works
2019-09-05 21:34:44 -04:00
Keenan Brock 8864eca801 tests to ensure parent.children.create works 2019-09-05 21:33:34 -04:00
Denny Mueller 11411f5040 use id in find instead of object 2019-09-05 21:26:49 -04:00
Keenan Brock c9ae6f14a3
Merge pull request #451 from kbrock/better_sanity
fix :primary_key_format
2019-09-05 21:01:46 -04:00
Keenan Brock a52697ba63 allow developer to specify :primary_key_format
it gets rid of a constant
it moves all the validation to one spot.

I'm thinking different strategies will have different schemes

I liked having it defined in materialized path, but wanted to get rid
of the constant more
2019-09-05 20:49:40 -04:00