I want to store mysql regular epxression to mysql database field. Specifically I want to store word boundaries expression into the database. For example:
[[:<:]]my expression here[[:>:]]
If I put this value directly into the database (for example using Sequel Pro) the value is stored correctly.
Problem occur when I want to store this value through Ruby on Rails:
my_instance.sql_expression = "[[:<:]]my expression here[[:>:]]"
my_instance.save
=> true
But value that is actually stored to database looks like this:
my_instance.sql_expression
=> "[[::]]"
It seems that in string Rails ignore everything what is between "<" and ">" including signs itselfs.
The project is in Ruby 1.8.7 and Rails 2.3.5.