Closed xpepermint closed 3 years ago
One alternative is to use pluck (:title)
I am closing all issues that are more than 6 years old now, as the gem has had significant updates and is likely people with these old issues are no longer having the issues. If you are currently still experiencing this issue or need help feel free to submit a new issue, thank you.
Example:
Model 1
class Point < ActiveRecord::Base belongs_to :imageable, :polymorphic => true acts_as_mappable end
Model 2
class Product < ActiveRecord::Base has_many :points, :as => :imageable acts_as_mappable :through => :points end
Controller
class ProductsController < ApplicationController def near @products = Product.all(:include => :points, :select => "title", :origin => origin, :within => distance) respond_to do |format| format.xml { render :xml => @products.to_xml(:include => :points) } end end end
Using :select => "title" does not work - the rule is ignored (all fields are selected not just title).