You can create a setter in your model that is not tied to a database field ... this setter will contain logic that determines how the string is divided into two parts, and sets two fields accordingly:
class MyModel
def mysetter=(string)
field1 = ...
field2 = ...
end
end
source
share