Hi,
I have the following code
@asset = Asset.first(:include => [:asset_statuses => [:asset_status_name, {:asset_location => [{:asset_floor => :asset_building}]}],:asset_type => [:asset_category => :asset_department]],
(probably not the best DB table desing but that's what I have to use...)
So, the Asset.first works correctly and it brings back the data correctly but when I try to use the same :include in to_json method if fails with the followings error:
@asset.to_json( :include => [:asset_statuses => [:asset_status_name, {:asset_location => [{:asset_floor => :asset_building}]}],:asset_type => [:asset_category => :asset_department]] )
NoMethodError (undefined method `macro' for nil:NilClass):
The json method has the same :include syntax as find, should it work in both?
Thanks - Erik