publinator 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ module Publinator
2
2
  class Page < ActiveRecord::Base
3
3
  self.table_name = 'publinator_pages'
4
4
  acts_as_publishable
5
- attr_accessible :body, :kicker, :subtitle, :teaser, :title, :section, :asset_items
5
+ attr_accessible :body, :kicker, :subtitle, :teaser, :title, :section, :asset_items, :asset_item, :asset_file
6
6
 
7
7
  def asset_types
8
8
  ['header']
@@ -13,7 +13,7 @@
13
13
  <%= form.semantic_fields_for :asset_items do |asset_form| %>
14
14
  <%= asset_form.inputs "Asset" do %>
15
15
  <%= asset_form.input :asset_type, :as => :select, :collection => @page.asset_types %>
16
- <%= asset_form.input :asset_file, :as => :file %>
16
+ <%= asset_form.input :asset, :as => :file %>
17
17
  <% end %>
18
18
  <% end %>
19
19
  <% end %>
@@ -2,7 +2,7 @@
2
2
  <h1><%= @page.title %></h1>
3
3
 
4
4
  <% @page.asset_types.each do |ai| %>
5
- <%= image_tag @page.asset_items.where(:asset_type => ai).first.asset_file.url %>
5
+ <%= image_tag @page.asset_files("header").first.asset.url if @page.asset_files("header") && @page.asset_files("header").first %>
6
6
  <% end %>
7
7
 
8
8
  <p>
data/config/routes.rb CHANGED
@@ -6,7 +6,6 @@ Publinator::Engine.routes.draw do
6
6
 
7
7
  Publinator::PublishableType.all.each do |pt|
8
8
  resources pt.name.pluralize.downcase.to_sym, :controller => "publishable", :publishable_type => pt.name.pluralize.downcase
9
- #match "/#{pt.name.pluralize.downcase}" => "publishable#index", :as => pt.name.pluralize.downcase, :publishable_type => pt.name
10
9
  end
11
10
 
12
11
  #constraints(Publinator::PublishableType) do
@@ -9,7 +9,7 @@ class CreatePublinatorSites < ActiveRecord::Migration
9
9
  t.string :abbr
10
10
  t.string :type
11
11
  t.boolean :default
12
-
12
+
13
13
  t.timestamps
14
14
  end
15
15
  end
@@ -10,7 +10,8 @@ class CreatePublinatorPublications < ActiveRecord::Migration
10
10
  t.datetime :publish_at
11
11
  t.datetime :unpublish_at
12
12
  t.datetime :archive_at
13
- t.references :publishable, :polymorphic => true
13
+ t.string :publishable_type
14
+ t.integer :publishable_id
14
15
  t.boolean :default
15
16
 
16
17
  t.timestamps
@@ -1,3 +1,3 @@
1
1
  module Publinator
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: publinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -350,7 +350,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
350
350
  version: '0'
351
351
  segments:
352
352
  - 0
353
- hash: 3405866272499408844
353
+ hash: -632280237461656463
354
354
  required_rubygems_version: !ruby/object:Gem::Requirement
355
355
  none: false
356
356
  requirements:
@@ -359,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
359
359
  version: '0'
360
360
  segments:
361
361
  - 0
362
- hash: 3405866272499408844
362
+ hash: -632280237461656463
363
363
  requirements: []
364
364
  rubyforge_project:
365
365
  rubygems_version: 1.8.24