effective_pages 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e0857bc336aef11ee45b65b154b193c4678cd1b
4
- data.tar.gz: 56fc281dce56d5538ff770985bea2ac49e62a5d7
3
+ metadata.gz: a79dbb57c52dbba7a942dc5ab61f99dea6c2a425
4
+ data.tar.gz: 2ff4f3480deba1e9393b951263f49cbd400cdfd6
5
5
  SHA512:
6
- metadata.gz: 328465e88b51fc487005c9513c2e226c190a5e603509da2b40a5536647f8e4b6bb21b3eb2bbc36c621c48a40cbc205cb67bc582bdc69ce82dd7b75da41bedb06
7
- data.tar.gz: 9da42b2ff1d138482de523a5cc4c8f655d46df5946e78fc9e07ce648dc0c1778ca6c76469995603f1745ef28005332444c5039a56d076a31c5ec9d6531caa88b
6
+ metadata.gz: 5a9d35738f11252819d50d853d94b310295e54baea224b899d061e8d248a181b8cbe5c213343990b38f5e0505ac82d0725d9f0f9120af59397e3ec412a0678a3
7
+ data.tar.gz: 19e5d44b424479ade5d01d74fdfd60ee93b0ea9423cc96d31bf13a310130d24e941511ec20cf79676be38f24bd586f8f3a1a5e70bc477564fd73032717087a0d
@@ -33,6 +33,8 @@ module Admin
33
33
  if @page.save
34
34
  if params[:commit] == 'Save and Edit Content' && defined?(EffectiveRegions)
35
35
  redirect_to effective_regions.edit_path(effective_pages.page_path(@page))
36
+ elsif params[:commit] == 'Save and Add New'
37
+ redirect_to effective_pages.new_admin_page_path
36
38
  else
37
39
  flash[:success] = 'Successfully created page'
38
40
  redirect_to effective_pages.edit_admin_page_path(@page)
@@ -59,6 +61,8 @@ module Admin
59
61
  if @page.update_attributes(page_params)
60
62
  if params[:commit] == 'Save and Edit Content' && defined?(EffectiveRegions)
61
63
  redirect_to effective_regions.edit_path(effective_pages.page_path(@page))
64
+ elsif params[:commit] == 'Save and Add New'
65
+ redirect_to effective_pages.new_admin_page_path
62
66
  else
63
67
  flash[:success] = 'Successfully updated page'
64
68
  redirect_to effective_pages.edit_admin_page_path(@page)
@@ -20,7 +20,7 @@ module Effective
20
20
 
21
21
  def self.update_from_effective_regions!(params)
22
22
  (params || {}).each do |menu_id, attributes|
23
- menu = Effective::Menu.find(menu_id)
23
+ menu = Effective::Menu.includes(:menu_items).find(menu_id)
24
24
 
25
25
  attributes[:menu_items_attributes].each { |_, atts| atts[:menuable_type] = 'Effective::Page' if atts[:menuable_type].blank? }
26
26
  menu.attributes = attributes
@@ -4,6 +4,8 @@ module Effective
4
4
  acts_as_role_restricted if defined?(EffectiveRoles)
5
5
  acts_as_regionable if defined?(EffectiveRegions)
6
6
 
7
+ has_many :menu_items, :as => :menuable, :dependent => :destroy
8
+
7
9
  self.table_name = EffectivePages.pages_table_name.to_s
8
10
 
9
11
  structure do
@@ -28,4 +28,5 @@
28
28
  = f.button :submit, 'Save'
29
29
  - if defined?(EffectiveRegions)
30
30
  = f.button :submit, 'Save and Edit Content'
31
+ = f.button :submit, 'Save and Add New'
31
32
  = link_to 'Cancel', effective_pages.admin_pages_path
@@ -1,3 +1,3 @@
1
1
  module EffectivePages
2
- VERSION = '0.9.1'.freeze
2
+ VERSION = '0.9.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-24 00:00:00.000000000 Z
11
+ date: 2015-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 1.1.0
103
+ version: 1.2.1
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 1.1.0
110
+ version: 1.2.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: effective_regions
113
113
  requirement: !ruby/object:Gem::Requirement