chili_pepper 0.1.5 → 0.1.7

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: 7c9a903f451c2c2ab096f4a2e8647480797283fd
4
- data.tar.gz: 7071f7ca0e1e7a265e4986091406b7e77ec994ed
3
+ metadata.gz: e833710587c77fa5ea24801d0d4b1120ae53da61
4
+ data.tar.gz: ffe08ad409952abae8ea429d9e7d9d0cdcd8d40d
5
5
  SHA512:
6
- metadata.gz: ebe1eb98076160efdf9a452d1036155a5af02826e0308dbfe4813bed41d648d37fd88cb502b75ef201fa206270bc2351d53223f54f7ccfd635ad7d4f0bae9875
7
- data.tar.gz: d44d214f69f1e7c238767e262cb77fe1028dcb967a2eae541e32ba731ae8e6710976260499775c0e594223d2b6cac59b5ec635e9f5c48987d57ba067250b5792
6
+ metadata.gz: 739f097e9ef3cd94149197029cce97984f30be8bdb24c3988232678d8c457f4a37ba2a0a0357ef9d9d63cfb4c8dc027f663ac5b0a759c8f391f802723d2d7e88
7
+ data.tar.gz: aa572699352ada43f1255414e64bfd02f67691cc4b0f81c7715d4dc6ec97d336604d2588ccac2719f5d3d66e3518ff47af8f2665955c4a4f6e3b080d69b6cfdb
@@ -22,7 +22,6 @@ module ChiliPepper
22
22
 
23
23
  def show
24
24
  @similar_menus = pick_similar_menus
25
-
26
25
  if @menu.sections.any?
27
26
  redirect_to menu_section_path(@menu, @menu.sections.position_sorted.first)
28
27
  else
@@ -41,7 +40,7 @@ module ChiliPepper
41
40
  if @menu.save
42
41
  redirect_to action: 'show', id: @menu
43
42
  # set_annotations_positions(@menu)
44
- # clear_menu_caches
43
+ clear_menu_caches
45
44
  else
46
45
  render action: :new
47
46
  end
@@ -54,7 +53,7 @@ module ChiliPepper
54
53
  if @menu.update(menu_params)
55
54
  redirect_to action: 'show', id: @menu
56
55
  # set_annotations_positions(@menu)
57
- # clear_menu_caches
56
+ clear_menu_caches
58
57
  else
59
58
  render action: :edit
60
59
  end
@@ -62,6 +61,7 @@ module ChiliPepper
62
61
 
63
62
  def destroy
64
63
  @menu.destroy
64
+ clear_menu_caches
65
65
  redirect_to action: :index
66
66
  end
67
67
 
@@ -69,16 +69,22 @@ module ChiliPepper
69
69
  params[:menu].each_with_index do |id, index|
70
70
  Menu.find(id).update_attributes(position: index + 1)
71
71
  end
72
+ clear_menu_caches
72
73
  render nothing: true
73
74
  end
74
75
 
75
76
  def duplicate
76
77
  @menu.duplicate
78
+ clear_menu_caches
77
79
  redirect_to menu_path(Menu.same_type_menus(@menu.menu_type).last)
78
80
  end
79
81
 
80
82
  private
81
83
 
84
+ def clear_menu_caches
85
+ Menu.all.each(&:touch)
86
+ end
87
+
82
88
  def menu
83
89
  @menu = Menu.friendly.find(params[:id]).decorate
84
90
  end
@@ -7,7 +7,8 @@ module ChiliPepper
7
7
  no_intra_emphasis: true
8
8
  }
9
9
  rtxt = Redcarpet::Markdown.new(renderer, options).render(text)
10
- return Regexp.new(/\A<p>(.*)<\/p>\Z/m).match(rtxt)[1].html_safe
10
+ matched_string = Regexp.new(/\A<p>(.*)<\/p>\Z/m).match(rtxt)
11
+ return matched_string[1].html_safe if matched_string.present?
11
12
  end
12
13
 
13
14
  def cache_or_admin(fragment_name, &block_to_be_executed)
@@ -1,3 +1,3 @@
1
1
  module ChiliPepper
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chili_pepper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loic Seigland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-13 00:00:00.000000000 Z
11
+ date: 2016-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -448,7 +448,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
448
448
  version: '0'
449
449
  requirements: []
450
450
  rubyforge_project:
451
- rubygems_version: 2.3.0
451
+ rubygems_version: 2.2.0
452
452
  signing_key:
453
453
  specification_version: 4
454
454
  summary: Rapid Creation of CMS for restaurant websites.