Commit Graph

231 Commits

Author SHA1 Message Date
Keenan Brock 1bbb0a9675 comments for v4.1.0 2021-06-24 23:41:14 -04:00
Matt Vague 86b84ceec0 Fix issue with counter cache and STI 2021-06-23 09:45:53 -07:00
Keenan Brock ef78cbed5c only run validation on ancestry column
was running into issues with pre-validation callbacks.
they were running a bunch of queries and requiring columns to be
in the model when we were only focused on the ancestry columns

this fixes that

before:

- run all prevalidation call backs
- run all validations
- check that ancestry did not thow an exception

after:

- run only ancestry validations

also consolidates 2 different ancestry checks
2021-06-09 09:43:33 -04:00
Keenan Brock 716b2d2d25
Merge pull request #542 from d-m-u/fix_sanity
change the valid check to not only run on the entire object
2021-06-03 12:06:47 -04:00
Keenan Brock b70976f1f4
Merge pull request #541 from kbrock/nulls_first
oracle use NULLS first
2021-05-26 04:10:04 -04:00
Keenan Brock 57a09f76e6 return self if root is invalid
much like we do with parent, if the root_id is invalid, then we continue on
as if nothing has happened wrong.

It was hard to decide what to return but returning self seems like the best option.
2021-05-26 04:03:20 -04:00
Keenan Brock c26c2ffbfa oracle use NULLS first
the order of nulls relative to columns with values is setup as
a default value in databases, which can be changed. The default for
postgres is to have nulls last. Looks like oracle has the same.

This PR has oracle enhanced driver follow suite as postgres.

Postgres and rails 6.0 and earlier had issues with the null first, so this is
feature limited to 6.1 and later
2021-05-26 04:02:21 -04:00
d-m-u 824e8e6464 change the valid to not only check the entire object 2021-05-20 11:32:02 -04:00
Keenan Brock 3171caf5e8 dont throw error for invalid parent
resolves https://github.com/stefankroes/ancestry/issues/523

if an invalid value is in the parent_id, `parent` will return nil not throw error
2021-04-20 13:28:04 -04:00
Keenan Brock f70a056de6
Merge pull request #530 from d-m-u/adding_changelog_recent_april_21
update changelog
2021-04-07 23:15:51 -04:00
Keenan Brock a208f32ad2
Merge pull request #522 from forever-inc/rails-6-deprecation-warnings
Fixes Rails 6 Scoping Deprecation Warnings
2021-04-07 22:59:46 -04:00
d-m-u 8ce5ee5f7e update changelog 2021-04-02 17:54:40 -04:00
Daniel Smith dfb4829e23 add: rails 6.1 and ruby 3 2021-02-05 12:16:52 -05:00
Keenan Brock 71fe704279
Merge pull request #526 from d-m-u/drop_ar_closed_interval_five_one_five_two
drop support for 5.0 and 5.1
2021-02-04 13:01:33 -05:00
Tom Smyth 201e59bc75
Fix order_by_ancestry_and for ActiveRecord 6.1
Restored the second arg to `reorder`
2021-01-30 16:01:15 -05:00
d-m-u d39ca3b99f drop support for five oh and five one 2021-01-21 13:31:58 -05:00
d-m-u 421826b67c use parens for args with blocks 2021-01-01 00:19:02 -05:00
d-m-u 78011f72bd fix end alignments 2020-12-31 22:19:07 -05:00
Chris Ryan 290a391807 Fixes Rails 6 Scoping Deprecation Warnings 2020-12-16 11:14:21 -05:00
Keenan Brock efa912d080
Merge pull request #519 from kbrock/has_parent
reduce the number of concepts
2020-10-31 21:56:28 -04:00
Keenan Brock 1fc26fb3ae reduce the number of concepts
don't need parent_id? and has_parent?
also merging our usage of ancestors? and has_parent? because they are the same
2020-10-30 21:46:22 -04:00
Akira Matsuda a6bf43683e No need to send a public method "Object#extend" 2020-10-18 21:24:31 +09:00
Keenan Brock 8b53592db9 drop rails 4.x 2020-10-08 10:57:47 -04:00
Keenan Brock 8b8bb233d3 Merge branch '3-2-stable' into master 2020-10-07 20:13:45 -04:00
Keenan Brock d888c03ed6
Merge pull request #501 from d-m-u/remove_sub_four_ar_check
remove code for old activerecord versions
2020-09-25 18:16:54 -04:00
Keenan Brock 610a25333c change log and version bump 2020-09-23 19:55:59 -04:00
Keenan Brock 01bbba0321
Merge pull request #509 from kbrock/release_3.2
prep for 3.2 release
2020-09-23 10:38:05 -04:00
Keenan Brock 61567ed617 prep for 3.2 release 2020-09-22 17:14:39 -04:00
Gabriel Reis e08d593e9f Remove postgresql check when including MaterializedPathPg 2020-09-17 15:08:49 -04:00
Keenan Brock 1b3977f03e For newer versions of rails and postgres, fix sorting 2020-09-16 14:51:36 -04:00
Anthony Batchelor f11cf9130a Convert error and exception strings to be internationalised 2020-09-04 21:19:18 -04:00
Keenan Brock 077d4b9e13 Merge branch 'pg-optimization' into master
This was from #497 and #466
2020-08-20 16:57:06 -04:00
Keenan Brock b071f08b6c default_update_strategy is user configurable 2020-08-20 16:14:47 -04:00
d-m-u 9c64e5781c address feedback 2020-08-20 15:50:22 -04:00
d-m-u 331793043b remove monkey patch and primary_key_is_an_integer? for AR < 4
do we still need either of these?

i think we're locked to >= 4.2
2020-08-10 01:13:56 -04:00
Keenan Brock 00d8ded2c9
Merge pull request #495 from kbrock/attribute_prep
sane_ancestor_ids and simplify specs
2020-08-09 21:09:34 -04:00
Keenan Brock a1e3e6b89a sane_ancestor_ids? 2020-08-03 19:57:39 -04:00
Keenan Brock 80fc77bdc5 use ancestor_ids in more tests 2020-08-03 19:55:43 -04:00
Keenan Brock 9c4eb7392a
Merge pull request #492 from d-m-u/remove_table_from_readme
cleanup the readme
2020-08-03 19:36:22 -04:00
d-m-u 36553a6b53 cleanup readme 2020-08-03 19:23:24 -04:00
Keenan Brock 2ea838fc6f Version 3.1.0 changelog 2020-08-03 18:15:57 -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
Maikel Linke 129c27b12f
Better humanise model name for error message 2020-07-09 16:47:11 +10:00
Keenan Brock 7ae7d45722 migrate from a non "parent_id" parent column
Fixes: #473
2020-05-27 18:43:09 -04:00
Minh Nguyen-Hue 4462c6b795 Address code review 2019-10-17 12:20:06 +07:00
Minh Nguyen-Hue 356cc0e6dc Add optimizer for postgres
# Summary

Currently, there is no way to make optimization for a specific
database.
This commit is to give an approach to help developer use specific
database technique to do optimization.
For examples, the origin `update_descendants_with_new_ancestry` has a
lot of N+1 queries to update all descendants. By using
`regexp_replace` on Postgres, we can use one query to remove N+1.
2019-10-16 12:24:17 +07: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