def as_json(options={})
      self.attributes.merge({
        :images => if self.product_images.any?
          self.product_images
        else
          [self.product.product_images.first]
        end
      })
    end
def as_json(options={})
      self.attributes.merge({
        :images => if self.product_images.any?
          self.product_images
        else
          [self.product.product_images.first]
        end
      })
    end
Instance Methods