is it possible to define a column in a model, which is not present in
the table? this column should return a combination of two other columns.
A and B are in the table, C isn't
I was thinking of attr_accessor, but i cant get it to work
You only need to use attr_accessor if you're looking to set the value as well as get it. You should just be able to create a method to do this:
class Cheese < ActiveRecord::Base
my_cheese = Cheese.new
my_cheese.origin = "Kent"
my_cheese.type = "Stilton"
puts my_cheese.name -> "Kent Stilton"
Hope that helps,