fullstack-cms 0.1.6 → 0.1.7

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
@@ -24,7 +24,11 @@ module PagesHelper
24
24
  page = resource_or_page.is_a?(Page) ? resource_or_page : Page.find_by_resource_type(resource_or_page.class.name.underscore)
25
25
  path = page.try(:path)
26
26
  if path.blank?
27
- "#"
27
+ Rails.logger.info "#{resource_or_page} non trovato"
28
+ Rails.logger.info "PAGINA: #{page}"
29
+ Rails.logger.info "Path: #{page.path}"
30
+
31
+ "#not-found"
28
32
  else
29
33
  path.gsub(/:[A-z_]+/) do |seg|
30
34
  meth = seg.gsub(/^:/, "")
@@ -19,6 +19,8 @@ module Pageable
19
19
  end
20
20
  end
21
21
 
22
+ resource_type = options.delete(:resource).try(:to_s)
23
+
22
24
  i18n_scope = "pages.#{self.name.underscore.split('/').last}##{name}"
23
25
  title = options.delete(:title) || I18n.t("#{i18n_scope}.title", :default => "#{name}".humanize)
24
26
 
@@ -26,11 +28,19 @@ module Pageable
26
28
 
27
29
  page = Page.find_or_create_by_uid(uid, :title => title, :name => name)
28
30
  if parent_uid
29
- parent = Page.find_by_uid(parent_uid.to_s)
31
+ parent = Page.find_by_uid(parent_uid)
30
32
  #raise [parent_uid.to_s, parent].inspect
31
33
  page.move_to_child_of(parent) unless page.parent == parent
32
34
  end
33
35
 
36
+ if resource_type
37
+ page.update_attribute(:resource_type, resource_type) unless page.resource_type == resource_type
38
+ end
39
+
40
+ if page.path != path
41
+ page.update_attribute(:path, path)
42
+ end
43
+
34
44
  end
35
45
 
36
46
  map(name, path, options = {}, &block)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "fullstack-cms"
8
- s.version = "0.1.6"
8
+ s.version = "0.1.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mcasimir"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fullstack-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -293,7 +293,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
293
293
  version: '0'
294
294
  segments:
295
295
  - 0
296
- hash: -744864392680158351
296
+ hash: -4076333191029679299
297
297
  required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  none: false
299
299
  requirements: