I hv the following model:
class User < ActiveRecord::Base
class Role < ActiveRecord::Base
When I run the following code:
user = User.find(:first)
there's no user_role attribute displayed. but when I run
user.user_role, it can give the expected result.
So, how can I get the associated attribute when using to_json ?
Appreciate for your help.