Skip to content

errors when annotating models with postgis fields #430

@abonec

Description

@abonec

ruby 2.3.1p112
rails 5.0.1
annotate 2.7.1
activerecord-postgis-adapter 4.0.0

schema for table:

  create_table "location", force: :cascade do |t|
    t.integer   "position"
    t.integer   "place_id",                                                                              null: false
    t.geography "geo_data",      limit: {:srid=>4326, :type=>"geometry", :geographic=>true}
    t.integer   "location_type",                                                             default: 1
    t.index "(COALESCE((st_startpoint((geo_data)::geometry))::geography, geo_data))", name: "geo_data_coalesce_ind", using: :gist
    t.index ["geo_data"], name: "geo_data_ind", using: :gist
    t.index ["place_id"], name: "index_location_on_place_id", using: :btree
  end

Last annotation of this model looks like:

# == Schema Information
#
# Table name: location
#
#  id            :integer          not null, primary key
#  position      :integer
#  place_id      :integer          not null
#  geo_data      :geography({:srid geometry, 4326
#  location_type :integer          default(1)
#
# Indexes
#
#  index_location_on_place_id  (place_id)
#
# Foreign Keys
#
#  fk_rails_8473fc2134  (place_id => place.id)
#

Error is:

rake db:migrate
Unable to annotate app/models/location.rb: undefined method `join' for #<String:0x000000055e9688>
Did you mean?  JSON
Unable to annotate app/models/location.rb: no implicit conversion of nil into Array
Model files unchanged.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions