georgia_blog 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 85e8250e827054ea0ba8e0527f47fde4a09f7410
4
- data.tar.gz: 1e4c8a783dd1a110b17797b576d8841a73f7afec
3
+ metadata.gz: 89e123475dda925b9c169a65d1f601ed968b3c15
4
+ data.tar.gz: 473fd88fca305cc99346b81c7dc1cc344818c394
5
5
  SHA512:
6
- metadata.gz: 5345d90113439e653d297c1f050d058811dc58488464b876cba27a3325b5b450d5f32e683ab301fb2d3aae203670da099a6199c1ac113a7ec2817c8789c43ac3
7
- data.tar.gz: a4186fa42cd0c3cb60430cdca585036e4a0292514e18b298bb951322c1bfabf2a382f065c5baa6cd5b471b7bde703201a206f3f5ec6158673642de6d0709e703
6
+ metadata.gz: a74913b3d30df19b83ca65c423af085bdaa8c4adfba780ac94e508948f4e8a13280247b14509dd672ed359d06be794a4e2567a565e9fc81b52a9ce6572d2e88d
7
+ data.tar.gz: b3e14474cc363c198d6726a251b119c44c109fb952a75f29c58022dde6fbc23e1889f278e49fcf27f49687f2d3fe5ec387d9afcdeb46e7411f17af147b17f2ae
@@ -1,4 +1,12 @@
1
1
  module Georgia
2
2
  class PostsController < Georgia::PagesController
3
+
4
+ before_filter :prepare_post_data, only: [:update, :settings]
5
+
6
+ private
7
+
8
+ def prepare_post_data
9
+ @post_data ||= @page.build_post_data unless @page and @page.post_data
10
+ end
3
11
  end
4
12
  end
@@ -5,7 +5,10 @@ module Georgia
5
5
  Georgia::Indexer.register_extension(:tire, Georgia::Post)
6
6
  include Georgia::Indexer::Adapter
7
7
 
8
- has_one :post_data
8
+ has_one :post_data, foreign_key: :post_id
9
+ accepts_nested_attributes_for :post_data
10
+ attr_accessible :post_data_attributes
11
+
9
12
  delegate :published_at, :month, :year, to: :post_data, prefix: false, allow_nil: true
10
13
 
11
14
  scope :recent, order("post_data.published_at DESC")
@@ -3,11 +3,13 @@
3
3
  <legend>Published Date</legend>
4
4
  </div>
5
5
  <div class="fieldset-fields">
6
- <div class='input-group date'>
7
- <%= f.input_field :published_at, as: :string, class: "form-control js-datepicker", data: {format: "DD-MM-YYYY HH:mm"}, value: f.object.published_at.strftime('%d-%m-%Y %H:%M') %>
8
- <span class="input-group-addon">
9
- <span class="fa fa-calendar"></span>
10
- </span>
11
- </div>
6
+ <%= f.fields_for :post_data do |pd| %>
7
+ <div class='input-group date'>
8
+ <%= pd.input_field :published_at, as: :string, class: "form-control js-datepicker", data: {format: "DD-MM-YYYY HH:mm"}, value: pd.object.try(:published_at).try(:strftime, '%d-%m-%Y %H:%M') %>
9
+ <span class="input-group-addon">
10
+ <span class="fa fa-calendar"></span>
11
+ </span>
12
+ </div>
13
+ <% end -%>
12
14
  </div>
13
15
  </fieldset>
@@ -2,5 +2,7 @@ module GeorgiaBlog
2
2
  class Engine < ::Rails::Engine
3
3
  require 'rubygems'
4
4
  require 'georgia'
5
+
6
+ extend Georgia::Paths
5
7
  end
6
8
  end
@@ -1,3 +1,3 @@
1
1
  module GeorgiaBlog
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: georgia_blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathieu Gagné
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-06 00:00:00.000000000 Z
11
+ date: 2014-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: georgia