-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
Merge branch 'master' of heroku.com:iupb-beta into develop # By Dirk Schumacher # Via Dirk Schumacher * 'master' of heroku.com:iupb-beta: update method also updates the youtube urls (further room for improvements ;))
Idea: We should enable translated attributes for the categories. Maybe category names in English makes navigating easier for international visitors |
We could do it if we also offered localized posts. I think we should move this idea to the issues page :) |
Issue created in #33. |
please also see #34 |
Sounds good. |
@@ -52,7 +52,7 @@ def update | |||
@ad = Ad.where(admin_token: params[:admin_token]).first | |||
if @ad | |||
set_youtube_thumbnail @ad | |||
if @ad.update_attributes(params[:ad]) && @ad.update #Can be done better, I know | |||
if @ad.update_attributes(params[:ad]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MichaelWhi are you sure that this also updates attributes not present in params[:ad]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what attributes are not set in params[:ad]?
But I'd think, yes... update_attributes just calls normal "save" on the object (itself) after setting the supplied attributes.
Just try it out =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it only updates the passed attributes and not the alternative_thumbnail. I believe I tried it before.
http://mongoid.org/en/mongoid/docs/persistence.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK… The behavior I mentioned was the standard active record behavior.
Just to be sure, I added a
params[:ad][:alternative_thumbnail_url] = ad.alternative_thumbnail_url
BTW: Always use the V2 Docs: http://two.mongoid.org/docs/persistence/standard.html#update_attributes
(We're locked in on the latest V.2.x version)
but only loads second page...
… develop # By Dirk Schumacher # Via Dirk Schumacher * 'develop' of https://github.com/dirkschumacher/iUPB: minor refactoring in ads coffee script
iUPB Version V2 with pinboard feature develop -> master
Finally merges our dev branch into master. After this one. we move to feature branching/pull-requests ;)
//cc @MichaelWhi