7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ancestry の has_ancestry :adoptオプション

Last updated at Posted at 2012-08-10

ツリー構造が作れるAncestryというgemがありまして、親が削除されたときの子の振る舞い、ツリーの再構築の方法をオプションで選べます。

ところが、

has_ancestry :orphan_strategy => :adopt

にすると、エラーではじかれRailsも起動しなくなる。

エラーをみたところ、どうやら:adoptのコードが含まれていない模様。

なので、

gem 'ancestry', git: "https://github.com/stefankroes/ancestry.git"

とgithubから直接コードをbundle installしたら動きました。

このオプション群、便利ですねー。

くわしくは、
https://github.com/stefankroes/ancestry
のReed meから!

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?