Ruby on Rails - MySql POINT type

I have a model with one attribute of type POINT. (MySql) How to set a model attribute via active record?

I'm looking for something like what I did in yii2:

$coordStr = 'POINT('.$object->latitude.' '.$object->longitude.')';
$object->coord = new yii\db\Expression("GeomFromText(:coord)", array(':coord' => $coordStr));

      

+3


source to share





All Articles