ecm_pictures 0.0.10 → 0.0.11

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.
@@ -58,6 +58,12 @@ if defined?(ActiveAdmin)
58
58
  end
59
59
  end
60
60
 
61
+ panel Ecm::Pictures::PictureGallery.human_attribute_name(:display_code) do
62
+ div do
63
+ ecm_pictures_picture_gallery.display_code
64
+ end
65
+ end
66
+
61
67
  panel Ecm::Pictures::PictureGallery.human_attribute_name(:pictures) do
62
68
  table_for ecm_pictures_picture_gallery.pictures, :i18n => Ecm::Pictures::Picture do
63
69
  sortable_columns
@@ -2,7 +2,7 @@ class Ecm::Pictures::PictureGallery < ActiveRecord::Base
2
2
  self.table_name = 'ecm_pictures_picture_galleries'
3
3
 
4
4
  # associations
5
- has_many :pictures
5
+ has_many :pictures, :dependent => :destroy
6
6
  accepts_nested_attributes_for :pictures, :allow_destroy => true
7
7
 
8
8
  # acts as list
@@ -22,6 +22,9 @@ class Ecm::Pictures::PictureGallery < ActiveRecord::Base
22
22
  # validations
23
23
  validates :name, :presence => true
24
24
 
25
+ def display_code
26
+ "<%= render_picture_gallery '#{self.name}' %>"
27
+ end
25
28
 
26
29
  def set_defaults
27
30
  if new_record?
@@ -4,6 +4,7 @@ de:
4
4
  ecm/pictures/picture_gallery:
5
5
  created_at: "Erstellt am"
6
6
  description: "Beschreibung"
7
+ display_code: "Anzeigecode"
7
8
  link_images: "Bilder verlinken"
8
9
  name: "Name"
9
10
  pictures: "Bilder"
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Pictures
3
- VERSION = "0.0.10"
3
+ VERSION = "0.0.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ecm_pictures
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.10
5
+ version: 0.0.11
6
6
  platform: ruby
7
7
  authors:
8
8
  - Roberto Vasquez Angel
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-06-20 00:00:00 Z
13
+ date: 2012-06-21 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails