Skip to content

Loading…

Annotate fails when is used module table_name_prefix #92

Closed
radeno opened this Issue · 2 comments

4 participants

@radeno

Hi,

annotable_models are very handy and easy to use gem (maybe rake task will be easier because have list [rake -T]).

This issue is about that it really great works on "standard" models but not on models within namespace and defined with table_name_prefix.

for example:

module Order
  def self.table_name_prefix
    'order_'
  end
end

and nested model

module Order
  class Item < ActiveRecord::Base
  end
end

Annotate models search in table items which not exists and right is order_items

@anamba

I have the same issue. I happen to have two models, one named Question and another named Exam::Question, and they use the questions and exam_questions tables, respectively. However, Exam::Question gets annotated with the columns from the questions table.

Edit: Sorry, that wasn't exactly right. The model files are okay, test/unit/exam/question_test.rb is the file that gets annotated incorrectly. No matter how many times I run annotate, it keeps saying: Annotated (2): Exam::Question, Question

@alexch
Collaborator
@ctran ctran closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.