Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with jbuilder 0.8.2 : "missing attribute: photo_updated_at" #76

Closed
youboox opened this issue Nov 5, 2012 · 1 comment
Closed

Comments

@youboox
Copy link

youboox commented Nov 5, 2012

Hi,

After updating my Rails 3.1 to 3.2 i have this error in one of my jbuilder partial :

Failure/Error: get :show, :id => @user.to_param, :format => :json
ActionView::Template::Error:
missing attribute: photo_updated_at
# ./app/views/api/user_ipads/_user_ipad.json.builder:11:in block in _app_views_api_user_ipads__user_ipad_json_builder__4322258879011176669_70322613825420' # ./app/views/api/user_ipads/_user_ipad.json.builder:1:in_app_views_api_user_ipads__user_ipad_json_builder__4322258879011176669_70322613825420'
# ./app/views/api/user_ipads/show.json.jbuilder:1:in _app_views_api_user_ipads_show_json_jbuilder___1496169294239287635_70322552739840' # ./spec/controllers/api/user_ipads_controller_spec.rb:56:inblock (4 levels) in <top (required)>'

This is very strange since my model has the photo_updated_at column, and i can access it without problem outside the jbuilder partial. Here is the line that create the issue :

Line 11 : json.photo @user_ipad.photo.url

json.user_ipad do |json|
json.id @user_ipad.id
json.is_premium @user_ipad.is_premium
json.email @user_ipad.email
json.authentication_token @user_ipad.authentication_token
json.pseudo @user_ipad.pseudo
json.first_name @user_ipad.first_name
json.last_name @user_ipad.last_name
json.male @user_ipad.male
json.birthday @user_ipad.birthday
json.photo @user_ipad.photo.url

end

Do you have any idea where it could come from ?

Thanks,
Vincent

@dhh
Copy link
Member

dhh commented Nov 27, 2012

I don't see it in your code example. I don't think this relates to jbuilder itself. But if you can replicate it in a failing test, please reopen.

@dhh dhh closed this as completed Nov 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants