Skip to content
This repository has been archived by the owner on Nov 30, 2017. It is now read-only.

iUPB Version V2 #28

Merged
merged 17 commits into from
Jan 20, 2013
Merged

iUPB Version V2 #28

merged 17 commits into from
Jan 20, 2013

Conversation

dirkschumacher
Copy link
Owner

Finally merges our dev branch into master. After this one. we move to feature branching/pull-requests ;)

//cc @MichaelWhi

MichaelWhi and others added 9 commits January 17, 2013 23:17
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 ;))
@ghost ghost assigned MichaelWhi Jan 19, 2013
@dirkschumacher
Copy link
Owner Author

RoR

@MichaelWhi
Copy link
Collaborator

Idea: We should enable translated attributes for the categories. Maybe category names in English makes navigating easier for international visitors

@dirkschumacher
Copy link
Owner Author

We could do it if we also offered localized posts. I think we should move this idea to the issues page :)

@MichaelWhi
Copy link
Collaborator

Issue created in #33.
However, I could live with shipping only translatable AdCategory and people rather type a translated version in the same filed below their text instead of giving a couple more input fields.

@MichaelWhi
Copy link
Collaborator

please also see #34

@dirkschumacher
Copy link
Owner Author

Issue created in #33.
However, I could live with shipping only translatable AdCategory and people rather type a translated version in the same filed below their text instead of giving a couple more input fields.

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])
Copy link
Owner Author

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]?

Copy link
Collaborator

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 =)

Copy link
Owner Author

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

Copy link
Collaborator

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)

@MichaelWhi
Copy link
Collaborator

ok, disabled the pageless JS thing (c76517e) + the menu entry is now hidden in production mode (522e015).
we can make categories and stuff =)

dirkschumacher added a commit that referenced this pull request Jan 20, 2013
iUPB Version V2 with pinboard feature develop -> master
@dirkschumacher dirkschumacher merged commit 2bdd7e3 into master Jan 20, 2013
@dirkschumacher dirkschumacher deleted the develop branch January 20, 2013 15:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants