1
Я пробовал amoeba версии 2.0.0 в консоли Rails (с Ruby 2.1). Это моя модель:Ruby on Rails + Amoeba Gem: undefined method 'macro'
class Dict < ActiveRecord::Base
belongs_to :user
has_many :cards, dependent: :destroy
has_many :idioms, through: :cards
end
class Card < ActiveRecord::Base
belongs_to :dict
has_many :idioms, dependent: :destroy
amoeba do
exclude_field :dict_id
end
end
class Idiom < ActiveRecord::Base
belongs_to :card
amoeba do
include_field :repres
include_field :card_id
include_field :kind
include_field :note
end
end
Теперь в консоли Rails Я пытаюсь
c=Card.find_by_id(19) # yields a Card object
c.amoeba_dup
Это вызывает исключение
NoMethodError: undefined method macro' for nil:NilClass
from .../amoeba-2.0.0/lib/amoeba.rb:412:in amo_process_association'
from .../amoeba-2.0.0/lib/amoeba.rb:381:in block in amoeba_dup'
from .../amoeba-2.0.0/lib/amoeba.rb:379:in each'
from ..../amoeba-2.0.0/lib/amoeba.rb:379:in amoeba_dup'
from .../amoeba-2.0.0/lib/amoeba.rb:457:in block in amo_process_association'
Где я допустил ошибку?