Not sure why there are 2 play methods (and I suspect that could be DRY'd up
too), but that doesn't mean this same $http code should be duped. Updating
the listens count should be a method on the audioFile model that is called
from both these places.
The audioFile model already has the logic to construct a url, you shouldn't
be doing again, and definitely not in a controller.



Andrew Kuklewicz


On Thu, Feb 20, 2014 at 2:04 PM, lasse christiansen <
notifications@github.com> wrote:

> In db/migrate/20140220173626_add_listens_to_audio_files.rb:
>
> > @@ -0,0 +1,9 @@
> > +class AddListensToAudioFiles < ActiveRecord::Migration
>
> I never did a rename. I added the column without removing the old one. The
> http is in both model and controller because audiofiles are played from
> both places.
> … <#14450af208c4a60a_>
> On Thu, Feb 20, 2014 at 11:02 AM, Andrew Kuklewicz <
> notifications@github.com > wrote: In
> db/migrate/20140220173626_add_listens_to_audio_files.rb: > @@ -0,0 +1,9 @@
> > +class AddListensToAudioFiles < ActiveRecord::Migration Is this adding
> listens, or should it be renaming play_count? -- Reply to this email
> directly or view it on GitHub<
> https://github.com/PRX/pop-up-archive/pull/467/files#r9919171> .
>  -- Lasse Christiansen 503-484-8760 links:
> http://linkedin.com/in/webdevlasse http://github.com/webdevlasse blog:
> http:///webdevlasse <http://webdevlasse.tumblr.com>*.tumblr.com <
> http://tumblr.com>*
>
> —
>
> Reply to this email directly or view it on GitHub<https://github.com/PRX/pop-up-archive/pull/467/files#r9919248>
> .
>
>