@@ -612,323 +612,9 @@ <h2>
612612< h2 >
613613< a name ="change-log " class ="anchor " href ="#change-log "> < span class ="octicon octicon-link "> </ span > </ a > Change log</ h2 >
614614
615- < h3 >
616- < a name ="423 " class ="anchor " href ="#423 "> < span class ="octicon octicon-link "> </ span > </ a > 4.2.3</ h3 >
617-
618- < ul >
619- < li > Fixed < code > attr_accessible?</ code > error introduced in 4.2.2 (< a href ="https://github.com/mceachen/closure_tree/issues/66 "> issue 66</ a > ).</ li >
620- < li > Switched to use new WithAdvisoryLock::DatabaseAdapterSupport (in v0.0.9) to add Postgis support</ li >
621- </ ul > < h3 >
622- < a name ="422 " class ="anchor " href ="#422 "> < span class ="octicon octicon-link "> </ span > </ a > 4.2.2</ h3 >
623-
624- < ul >
625- < li > Support attr_accessible and strong_attributes even if you're on Rails 4</ li >
626- </ ul > < h3 >
627- < a name ="421 " class ="anchor " href ="#421 "> < span class ="octicon octicon-link "> </ span > </ a > 4.2.1</ h3 >
628-
629- < ul >
630- < li > Deleting from NumericDeterministicOrdering doesn't create sort order gaps anymore.</ li >
631- </ ul > < h3 >
632- < a name ="420 " class ="anchor " href ="#420 "> < span class ="octicon octicon-link "> </ span > </ a > 4.2.0</ h3 >
633-
634- < ul >
635- < li > Added < code > with_ancestor(*ancestors)</ code > . Thanks for the idea, < a href ="https://github.com/mgornick "> Matt</ a > !</ li >
636- < li > Applied < a href ="https://github.com/leonelgalan "> Leonel Galan</ a > 's fix for Strong Attribute support</ li >
637- < li >
638- < code > find_or_create_by</ code > now uses passed-in attributes as both selection and creation criteria.
639- Thanks for the help, < a href ="https://github.com/juddblair "> Judd Blair</ a > !
640- < strong > Please note that this changes prior behavior—test your code with this new version!</ strong >
641- </ li >
642- < li >
643- < code > ct_advisory_lock</ code > was moved into the < code > _ct</ code > support class, to reduce model method pollution</ li >
644- < li > Moved a bunch of code into more focused piles of module mixins</ li >
645- </ ul > < h3 >
646- < a name ="410 " class ="anchor " href ="#410 "> < span class ="octicon octicon-link "> </ span > </ a > 4.1.0</ h3 >
647-
648- < ul >
649- < li > Added support for Rails 4.0.0.rc1 and Ruby 2.0.0 (while maintaining backward compatibility with Rails 3, BOOYA)</ li >
650- < li > Added < code > #to_dot_digraph</ code > , suitable for Graphviz rendering</ li >
651- </ ul > < h3 >
652- < a name ="401 " class ="anchor " href ="#401 "> < span class ="octicon octicon-link "> </ span > </ a > 4.0.1</ h3 >
653-
654- < ul >
655- < li > < p > Numeric, deterministically ordered siblings will always be < a href ="previously,%20the%20sort%20order%20might%20use%20negative%20values,%20which%20broke%20the%20preordering "> 0..#{self_and_siblings.count}</ a > .
656- Resolves < a href ="https://github.com/mceachen/closure_tree/issues/49 "> issue 49</ a > . Thanks for the help,
657- < a href ="https://github.com/leonelgalan "> Leonel Galan</ a > , < a href ="https://github.com/elhoyos "> Juan Hoyos</ a > , and
658- < a href ="https://github.com/elfassy "> Michael Elfassy</ a > !</ p > </ li >
659- < li > < p > The < code > order</ code > option can be a symbol now. Resolves < a href ="https://github.com/mceachen/closure_tree/issues/46 "> issue 46</ a > .</ p > </ li >
660- </ ul > < h3 >
661- < a name ="400 " class ="anchor " href ="#400 "> < span class ="octicon octicon-link "> </ span > </ a > 4.0.0</ h3 >
662-
663- < ul >
664- < li >
665- < p > Moved all of closure_tree's implementation-detail methods into a < code > ClosureTree::Support</ code >
666- instance, which removes almost all of the namespace pollution in your models that wasn't
667- for normal consumption. If you were using any of these methods, they're now available through
668- the "_ct" class and instance member.</ p >
669-
670- < p > < em > This change may break consumers</ em > , so I incremented the major version number, even though no new
671- functionality was released.</ p >
672- </ li >
673- </ ul > < h3 >
674- < a name ="3102 " class ="anchor " href ="#3102 "> < span class ="octicon octicon-link "> </ span > </ a > 3.10.2</ h3 >
675-
676- < ul >
677- < li > < p > Prevent faulty SQL statement when < code > #siblings</ code > is called on an unsaved records.
678- Resolves < a href ="https://github.com/mceachen/closure_tree/pull/52 "> issue 52</ a > . Perfect pull
679- request by < a href ="https://github.com/garygreyling "> Gary Greyling</ a > .</ p > </ li >
680- < li > < p > The < code > .roots</ code > class method now correctly respects the < code > :order</ code > option.
681- Resolves < a href ="https://github.com/mceachen/closure_tree/issues/53 "> issue 53</ a > .
682- Thanks for finding this, < a href ="https://github.com/brendon "> Brendon Muir</ a > !</ p > </ li >
683- </ ul > < h3 >
684- < a name ="3101 " class ="anchor " href ="#3101 "> < span class ="octicon octicon-link "> </ span > </ a > 3.10.1</ h3 >
685-
686- < ul >
687- < li > < p > Multipart constant names like "Admin::PageHierarchy" are now supported.
688- Resolves < a href ="https://github.com/mceachen/closure_tree/issues/47 "> issue 47</ a > .
689- Thanks for the perfect pull request, < a href ="https://github.com/fd "> Simon Menke</ a > !</ p > </ li >
690- < li > < p > Committing transactions involving large numbers of hierarchy model classes was very slow due
691- to hash collisions in the hierarchy class. A better hash implementation addressed
692- < a href ="https://github.com/mceachen/closure_tree/issues/48 "> issue 48</ a > .
693- Thanks, < a href ="https://github.com/jturkel "> Joel Turkel</ a > !</ p > </ li >
694- </ ul > < h3 >
695- < a name ="3100 " class ="anchor " href ="#3100 "> < span class ="octicon octicon-link "> </ span > </ a > 3.10.0</ h3 >
696-
697- < ul >
698- < li > Added < code > #roots_and_descendants_preordered</ code > .
699- Thanks for the suggestion, < a href ="https://github.com/leonelgalan "> Leonel Galan</ a > !</ li >
700- </ ul > < h3 >
701- < a name ="390 " class ="anchor " href ="#390 "> < span class ="octicon octicon-link "> </ span > </ a > 3.9.0</ h3 >
702-
703- < ul >
704- < li > Added < code > .child_ids</ code > .</ li >
705- < li > Removed < code > dependent => destroy</ code > on the descendant_hierarchy and ancestor_hierarchy collections
706- (they were a mistake).</ li >
707- < li > Clarified documentation for creation and child associations.
708- Because < code > Tag.create!(:parent => ...)</ code > requires a < code > .reload</ code > , I removed it as an example.</ li >
709- </ ul > < p > All three of these improvements were suggested by Andrew Bromwich. Thanks!</ p >
710-
711- < h3 >
712- < a name ="382 " class ="anchor " href ="#382 "> < span class ="octicon octicon-link "> </ span > </ a > 3.8.2</ h3 >
713-
714- < ul >
715- < li > find_by_path uses 1 SELECT now. BOOM.</ li >
716- </ ul > < h3 >
717- < a name ="381 " class ="anchor " href ="#381 "> < span class ="octicon octicon-link "> </ span > </ a > 3.8.1</ h3 >
718-
719- < ul >
720- < li > Double-check locking for find_or_create_by_path</ li >
721- </ ul > < h3 >
722- < a name ="380 " class ="anchor " href ="#380 "> < span class ="octicon octicon-link "> </ span > </ a > 3.8.0</ h3 >
723-
724- < ul >
725- < li > Support for preordered descendants. This requires a numeric sort order column.
726- Resolves < a href ="https://github.com/mceachen/closure_tree/issues/38 "> feature request 38</ a > .</ li >
727- < li > Moved modules from < code > acts_as_tree</ code > into separate files</ li >
728- </ ul > < h3 >
729- < a name ="373 " class ="anchor " href ="#373 "> < span class ="octicon octicon-link "> </ span > </ a > 3.7.3</ h3 >
730-
731- < p > Due to MySQL's inability to lock rows properly, I've switched to advisory_locks for
732- all write paths. This will prevent deadlocks, addressing
733- < a href ="https://github.com/mceachen/closure_tree/issues/41 "> issue 41</ a > .</ p >
734-
735- < h3 >
736- < a name ="372 " class ="anchor " href ="#372 "> < span class ="octicon octicon-link "> </ span > </ a > 3.7.2</ h3 >
737-
738- < ul >
739- < li > Support for UUID primary keys. Addresses
740- < a href ="https://github.com/mceachen/closure_tree/issues/40 "> issue 40</ a > . Thanks for the pull request,
741- < a href ="https://github.com/calexicoz "> Julien</ a > !</ li >
742- </ ul > < h3 >
743- < a name ="371 " class ="anchor " href ="#371 "> < span class ="octicon octicon-link "> </ span > </ a > 3.7.1</ h3 >
744-
745- < ul >
746- < li > Moved requires into ActiveSupport.on_load</ li >
747- < li > Added < code > require 'with_advisory_lock'</ code >
748- </ li >
749- </ ul > < h3 >
750- < a name ="370 " class ="anchor " href ="#370 "> < span class ="octicon octicon-link "> </ span > </ a > 3.7.0</ h3 >
751-
752- < p > < strong > Thread safety!</ strong > </ p >
753-
754- < ul >
755- < li >
756- < a href ="https://github.com/mceachen/with_advisory_lock "> Advisory locks</ a > were
757- integrated with the class-level < code > find_or_create_by_path</ code > and < code > rebuild!</ code > .</ li >
758- < li > Pessimistic locking is used by the instance-level < code > find_or_create_by_path</ code > .</ li >
759- </ ul > < h3 >
760- < a name ="369 " class ="anchor " href ="#369 "> < span class ="octicon octicon-link "> </ span > </ a > 3.6.9</ h3 >
761-
762- < ul >
763- < li >
764- < a href ="https://github.com/elskwid "> Don Morrison</ a > massaged the < a href ="#nested-hashes "> #hash_tree</ a > query to
765- be more efficient, and found a bug in < code > hash_tree</ code > 's query that resulted in duplicate rows,
766- wasting time on the ruby side.</ li >
767- </ ul > < h3 >
768- < a name ="367 " class ="anchor " href ="#367 "> < span class ="octicon octicon-link "> </ span > </ a > 3.6.7</ h3 >
769-
770- < ul >
771- < li > Added workaround for ActiveRecord::Observer usage pre-db-creation. Addresses
772- < a href ="https://github.com/mceachen/closure_tree/issues/32 "> issue 32</ a > .
773- Thanks, < a href ="https://github.com/elskwid "> Don Morrison</ a > !</ li >
774- </ ul > < h3 >
775- < a name ="366 " class ="anchor " href ="#366 "> < span class ="octicon octicon-link "> </ span > </ a > 3.6.6</ h3 >
776-
777- < ul >
778- < li > Added support for Rails 4's < a href ="https://github.com/rails/strong_parameters "> strong parameter</ a > .
779- Thanks, < a href ="https://github.com/bensie "> James Miller</ a > !</ li >
780- </ ul > < h3 >
781- < a name ="365 " class ="anchor " href ="#365 "> < span class ="octicon octicon-link "> </ span > </ a > 3.6.5</ h3 >
782-
783- < ul >
784- < li > Use < code > quote_table_name</ code > instead of < code > quote_column_name</ code > . Addresses
785- < a href ="https://github.com/mceachen/closure_tree/issues/29 "> issue 29</ a > . Thanks,
786- < a href ="https://github.com/vjt "> Marcello Barnaba</ a > !</ li >
787- </ ul > < h3 >
788- < a name ="364 " class ="anchor " href ="#364 "> < span class ="octicon octicon-link "> </ span > </ a > 3.6.4</ h3 >
789-
790- < ul >
791- < li > Use < code > .pluck</ code > when available for < code > .ids_from</ code > . Addresses
792- < a href ="https://github.com/mceachen/closure_tree/issues/26 "> issue 26</ a > . Thanks,
793- < a href ="https://github.com/sturgill "> Chris Sturgill</ a > !</ li >
794- </ ul > < h3 >
795- < a name ="363 " class ="anchor " href ="#363 "> < span class ="octicon octicon-link "> </ span > </ a > 3.6.3</ h3 >
796-
797- < ul >
798- < li > Fixed < a href ="https://github.com/mceachen/closure_tree/issues/24 "> issue 24</ a > , which optimized < code > #hash_tree</ code >
799- for roots. Thanks, < a href ="https://github.com/rewritten "> Saverio Trioni</ a > !</ li >
800- </ ul > < h3 >
801- < a name ="362 " class ="anchor " href ="#362 "> < span class ="octicon octicon-link "> </ span > </ a > 3.6.2</ h3 >
802-
803- < ul >
804- < li > Fixed < a href ="https://github.com/mceachen/closure_tree/issues/23 "> issue 23</ a > , which added support for < code > #siblings</ code >
805- when sort_order wasn't specified. Thanks, < a href ="https://github.com/garygreyling "> Gary Greyling</ a > !</ li >
806- </ ul > < h3 >
807- < a name ="361 " class ="anchor " href ="#361 "> < span class ="octicon octicon-link "> </ span > </ a > 3.6.1</ h3 >
808-
809- < ul >
810- < li > Fixed < a href ="https://github.com/mceachen/closure_tree/issues/20 "> issue 20</ a > , which affected
811- deterministic ordering when siblings where different STI classes. Thanks, < a href ="https://github.com/edwinramirez "> edwinramirez</ a > !</ li >
812- </ ul > < h3 >
813- < a name ="360 " class ="anchor " href ="#360 "> < span class ="octicon octicon-link "> </ span > </ a > 3.6.0</ h3 >
814-
815- < p > Added support for:</ p >
816-
817- < ul >
818- < li >
819- < code > :hierarchy_class_name</ code > as an option</ li >
820- < li > ActiveRecord::Base.table_name_prefix</ li >
821- < li > ActiveRecord::Base.table_name_suffix</ li >
822- </ ul > < p > This addresses < a href ="https://github.com/mceachen/closure_tree/issues/21 "> issue 21</ a > . Thanks, < a href ="https://github.com/juddblair "> Judd Blair</ a > !</ p >
823-
824- < h3 >
825- < a name ="352 " class ="anchor " href ="#352 "> < span class ="octicon octicon-link "> </ span > </ a > 3.5.2</ h3 >
826-
827- < ul >
828- < li > Added < code > find_all_by_generation</ code >
829- for < a href ="https://github.com/mceachen/closure_tree/issues/17 "> feature request 17</ a > .</ li >
830- </ ul > < h3 >
831- < a name ="342 " class ="anchor " href ="#342 "> < span class ="octicon octicon-link "> </ span > </ a > 3.4.2</ h3 >
832-
833- < ul >
834- < li > Fixed < a href ="https://github.com/mceachen/closure_tree/issues/18 "> issue 18</ a > , which affected
835- append_node/prepend_node ordering when the first node didn't have an explicit order_by value</ li >
836- </ ul > < h3 >
837- < a name ="341 " class ="anchor " href ="#341 "> < span class ="octicon octicon-link "> </ span > </ a > 3.4.1</ h3 >
838-
839- < ul >
840- < li > Reverted .gemspec mistake that changed add_development_dependency to add_runtime_dependency</ li >
841- </ ul > < h3 >
842- < a name ="340 " class ="anchor " href ="#340 "> < span class ="octicon octicon-link "> </ span > </ a > 3.4.0</ h3 >
843-
844- < p > Fixed < a href ="https://github.com/mceachen/closure_tree/issues/15 "> issue 15</ a > :</ p >
845-
846- < ul >
847- < li > "parent" is now attr_accessible, which adds support for constructor-provided parents.</ li >
848- < li > updated readme accordingly</ li >
849- </ ul > < h3 >
850- < a name ="332 " class ="anchor " href ="#332 "> < span class ="octicon octicon-link "> </ span > </ a > 3.3.2</ h3 >
851-
852- < ul >
853- < li > Merged calebphillips' patch for a more efficient leaves query</ li >
854- </ ul > < h3 >
855- < a name ="331 " class ="anchor " href ="#331 "> < span class ="octicon octicon-link "> </ span > </ a > 3.3.1</ h3 >
856-
857- < ul >
858- < li > Added support for partially-unsaved hierarchies < a href ="https://github.com/mceachen/closure_tree/issues/13 "> issue 13</ a > :
859- < code >
860- a = Tag.new(name: "a")
861- b = Tag.new(name: "b")
862- a.children << b
863- a.save
864- </ code >
865- </ li >
866- </ ul > < h3 >
867- < a name ="330 " class ="anchor " href ="#330 "> < span class ="octicon octicon-link "> </ span > </ a > 3.3.0</ h3 >
868-
869- < ul >
870- < li > Added < a href ="#nested-hashes "> < code > hash_tree</ code > </ a > .</ li >
871- </ ul > < h3 >
872- < a name ="321 " class ="anchor " href ="#321 "> < span class ="octicon octicon-link "> </ span > </ a > 3.2.1</ h3 >
873-
874- < ul >
875- < li > Added < code > ancestor_ids</ code > , < code > descendant_ids</ code > , and < code > sibling_ids</ code >
876- </ li >
877- < li > Added example spec to solve < a href ="https://github.com/mceachen/closure_tree/issues/9 "> issue 9</ a >
878- </ li >
879- </ ul > < h3 >
880- < a name ="320 " class ="anchor " href ="#320 "> < span class ="octicon octicon-link "> </ span > </ a > 3.2.0</ h3 >
881-
882- < ul >
883- < li > Added support for deterministic ordering of nodes.</ li >
884- </ ul > < h3 >
885- < a name ="310 " class ="anchor " href ="#310 "> < span class ="octicon octicon-link "> </ span > </ a > 3.1.0</ h3 >
886-
887- < ul >
888- < li > Switched to using < code > has_many :though</ code > rather than < code > has_and_belongs_to_many</ code >
889- </ li >
890- </ ul > < h3 >
891- < a name ="304 " class ="anchor " href ="#304 "> < span class ="octicon octicon-link "> </ span > </ a > 3.0.4</ h3 >
892-
893- < ul >
894- < li > Merged < a href ="https://github.com/mceachen/closure_tree/pull/8 "> pull request</ a > to fix < code > .siblings</ code > and < code > .self_and_siblings</ code >
895- (Thanks, < a href ="https://github.com/eljojo "> eljojo</ a > !)</ li >
896- </ ul > < h3 >
897- < a name ="303 " class ="anchor " href ="#303 "> < span class ="octicon octicon-link "> </ span > </ a > 3.0.3</ h3 >
898-
899- < ul >
900- < li > Added support for ActiveRecord's whitelist_attributes
901- (Make sure you read < a href ="http://guides.rubyonrails.org/security.html "> the Rails Security Guide</ a > , and
902- enable < code > config.active_record.whitelist_attributes</ code > in your < code > config/application.rb</ code > ASAP!)</ li >
903- </ ul > < h3 >
904- < a name ="302 " class ="anchor " href ="#302 "> < span class ="octicon octicon-link "> </ span > </ a > 3.0.2</ h3 >
905-
906- < ul >
907- < li > Fix for ancestry-loop detection (performed by a validation, not through raising an exception in before_save)</ li >
908- </ ul > < h3 >
909- < a name ="301 " class ="anchor " href ="#301 "> < span class ="octicon octicon-link "> </ span > </ a > 3.0.1</ h3 >
910-
911- < ul >
912- < li > Support 3.2.0's fickle deprecation of InstanceMethods (Thanks, < a href ="https://github.com/mceachen/closure_tree/pull/5 "> jheiss</ a > )!</ li >
913- </ ul > < h3 >
914- < a name ="300 " class ="anchor " href ="#300 "> < span class ="octicon octicon-link "> </ span > </ a > 3.0.0</ h3 >
615+ < p > See < a href ="https://github.com/mceachen/closure_tree/blob/master/CHANGELOG.md "> https://github.com/mceachen/closure_tree/blob/master/CHANGELOG.md</ a > </ p >
915616
916- < ul >
917- < li > Support for polymorphic trees</ li >
918- < li >
919- < code > find_by_path</ code > and < code > find_or_create_by_path</ code > signatures changed to support constructor attributes</ li >
920- < li > tested against Rails 3.1.3</ li >
921- </ ul > < h3 >
922- < a name ="200 " class ="anchor " href ="#200 "> < span class ="octicon octicon-link "> </ span > </ a > 2.0.0</ h3 >
923-
924- < ul >
925- < li > Had to increment the major version, as rebuild! will need to be called by prior consumers to support the new < code > leaves</ code > class and instance methods.</ li >
926- < li > Tag deletion is supported now along with < code > :dependent => :destroy</ code > and < code > :dependent => :delete_all</ code >
927- </ li >
928- < li > Switched from default rails plugin directory structure to rspec</ li >
929- < li > Support for running specs under different database engines: < code > export DB ; for DB in sqlite3 mysql postgresql ; do rake ; done</ code >
930- </ li >
931- </ ul > < h2 >
617+ < h2 >
932618< a name ="thanks-to " class ="anchor " href ="#thanks-to "> < span class ="octicon octicon-link "> </ span > </ a > Thanks to</ h2 >
933619
934620< ul >
0 commit comments