Some of attributes specified in ActiveModel are non db attributes which are just defined as getter setter. Problem is that these attributes values are not reflected on activeresource record on client side.
#server side code
class Item < ActiveRecord::Base
#not null name attribute defined on db
end
class SpecialItem < ActiveRecord::Base
#nullable item_name attribute defined on db
#association many to one for item defined here
#name accessor
def name
if !item_name.nil?
return item_name
else
return item.name
end
end
end
#client side code
class SpecialItem < ActiveResource::Base
schema do
attribute 'name', 'string'
end
end
I am getting nil value for attribute name for SepcialItem record on client. Basically i am trying to map accessor method name to name attribute on client side.
What is possible solution?