refinerycms-pdf_newsletters 1.3 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,17 +5,12 @@ class PdfNewslettersController < ApplicationController
5
5
  before_filter :find_page
6
6
 
7
7
  def index
8
- # you can use meta fields from your model instead (e.g. browser_title)
9
- # by swapping @page for @newsletter in the line below:
10
8
  present(@page)
11
9
  end
12
10
 
13
11
  def show
14
12
  @newsletter = PdfNewsletter.find(params[:id])
15
-
16
- # you can use meta fields from your model instead (e.g. browser_title)
17
- # by swapping @page for @newsletter in the line below:
18
- present(@page)
13
+ redirect_to @newsletter.pdf.url
19
14
  end
20
15
 
21
16
  protected
@@ -8,6 +8,10 @@ class PdfNewsletter < ActiveRecord::Base
8
8
 
9
9
  belongs_to :pdf, :class_name => 'Resource'
10
10
 
11
+ def title
12
+ "#{month} Newsletter"
13
+ end
14
+
11
15
  def month
12
16
  self.publish_on.strftime("%B")
13
17
  end
@@ -24,4 +28,8 @@ class PdfNewsletter < ActiveRecord::Base
24
28
  def self.current
25
29
  self.recent.first
26
30
  end
31
+
32
+ def self.whats_new?
33
+ true
34
+ end
27
35
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: refinerycms-pdf_newsletters
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: "1.3"
5
+ version: "1.4"
6
6
  platform: ruby
7
7
  authors:
8
8
  - Doug Bradbury <doug@8thlight.com>