annotate_models icon indicating copy to clipboard operation
annotate_models copied to clipboard

ActiveRecord::ConnectionAdapters::Column.new error

Open dudo opened this issue 6 years ago • 1 comments

When running annotate, models fail when they define virtual columns.

Unable to annotate app/models/my_model.rb: undefined method `sql_type' for :string:Symbol

Where MyModel has

class MyModel
  def self.columns
    # Adding a virtual attribute to the model for serializer to work
    super << ActiveRecord::ConnectionAdapters::Column.new('foo', nil, :string)
  end
end

Version

  • annotate version 3.0.2
  • rails version 5.2.3
  • ruby version 2.6.5

dudo avatar Nov 04 '19 18:11 dudo

Did you get to solve it?

icodeat9 avatar Nov 10 '21 20:11 icodeat9