comfortable_mexican_sofa 1.0.15 → 1.0.16

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.15
1
+ 1.0.16
@@ -95,6 +95,7 @@ class CmsPage < ActiveRecord::Base
95
95
  # Processing content will return rendered content and will populate
96
96
  # self.cms_tags with instances of CmsTag
97
97
  def content
98
+ self.cms_tags = [] # resetting
98
99
  cms_layout ? CmsTag.process_content(self, cms_layout.merged_content) : ''
99
100
  end
100
101
 
@@ -1,7 +1,7 @@
1
1
  <div id='form_blocks'>
2
2
  <%= fields_for :cms_blocks, :builder => ComfortableMexicanSofa::FormBuilder do |cms_blocks| %>
3
3
  <% @cms_page.cms_tags(true).each do |tag| %>
4
- <%= cms_blocks.send(tag.class.to_s.underscore.downcase.idify, tag)%>
4
+ <%= cms_blocks.send(tag.class.name.underscore.downcase.idify, tag)%>
5
5
  <% end %>
6
6
  <% end %>
7
7
  </div>
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{comfortable_mexican_sofa}
8
- s.version = "1.0.15"
8
+ s.version = "1.0.16"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Oleg Khabarov", "The Working Group Inc"]
12
- s.date = %q{2010-11-08}
12
+ s.date = %q{2010-11-09}
13
13
  s.description = %q{}
14
14
  s.email = %q{oleg@theworkinggroup.ca}
15
15
  s.extra_rdoc_files = [
@@ -42,7 +42,7 @@ class ComfortableMexicanSofa::FormBuilder < ActionView::Helpers::FormBuilder
42
42
  # -- Tag Field Fields -----------------------------------------------------
43
43
  def default_tag_field(tag, options = {})
44
44
  label = options[:label] || tag.label.to_s.titleize
45
- css_class = options[:css_class] || tag.class.to_s.underscore.downcase.idify
45
+ css_class = options[:css_class] || tag.class.name.underscore.downcase.idify
46
46
 
47
47
  options[:content_field_method] ||= :text_field_tag
48
48
  field =
@@ -7,7 +7,7 @@ namespace :comfortable_mexican_sofa do
7
7
  abort('ComfortableMexicanSofa.config.seed_data_path is not set. Where are those yaml files?')
8
8
  end
9
9
  if !(@site = CmsSite.find_by_hostname(args[:hostname]))
10
- abort("Can't find site with HOSTNAME '#{args[:site]}'")
10
+ abort("Can't find site with HOSTNAME '#{args[:hostname]}'")
11
11
  end
12
12
  puts "Starting import into #{@site.label} (#{@site.hostname})..."
13
13
  end
@@ -29,7 +29,7 @@ namespace :comfortable_mexican_sofa do
29
29
  layout.parent = (parent rescue nil)
30
30
  should_write = true
31
31
  existing_layout = nil
32
-
32
+
33
33
  if existing_layout = @site.cms_layouts.find_by_slug(layout.slug)
34
34
  print "Found layout in database with slug: #{layout.slug}. Overwrite? (yN): "
35
35
  should_write = ($stdin.gets.to_s.strip.downcase == 'y')
@@ -18,4 +18,4 @@ child:
18
18
  slug: 'child-page'
19
19
  full_path: '/child-page'
20
20
  children_count: 0
21
- position: 0
21
+ position: 0
@@ -258,4 +258,5 @@ class CmsAdmin::PagesControllerTest < ActionController::TestCase
258
258
  assert_equal 3, assigns(:cms_page).cms_tags.size
259
259
  assert_template :form_blocks
260
260
  end
261
+
261
262
  end
@@ -202,4 +202,30 @@ class CmsTagTest < ActiveSupport::TestCase
202
202
  ), page.content
203
203
  assert_equal 6, page.cms_tags.size
204
204
  end
205
+
206
+ def test_tag_initialization_for_existing_blocks_with_different_type
207
+ layout = cms_layouts(:default)
208
+ page = cms_pages(:default)
209
+
210
+ assert page.content
211
+ assert_equal 4, page.cms_tags.size
212
+ assert tag = page.cms_tags.first
213
+ assert !tag.new_record?
214
+ assert_equal 'CmsTag::FieldText', tag.class.name
215
+ assert_equal 'CmsTag::FieldText', tag.type
216
+ assert_equal 'default_field_text', tag.label
217
+ assert_equal 'default_field_text_content', tag.content
218
+
219
+ layout.update_attribute(:content, '{{cms:page:default_field_text:string}}')
220
+ page.reload
221
+ assert page.content
222
+ assert_equal 1, page.cms_tags.size
223
+ assert tag = page.cms_tags.first
224
+ assert !tag.new_record?
225
+ assert_equal 'CmsTag::FieldText', tag.class.name
226
+ assert_equal 'CmsTag::PageString', tag.type
227
+ assert_equal 'default_field_text', tag.label
228
+ assert_equal 'default_field_text_content', tag.content
229
+ end
230
+
205
231
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfortable_mexican_sofa
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 15
10
- version: 1.0.15
9
+ - 16
10
+ version: 1.0.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Oleg Khabarov
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-11-08 00:00:00 -05:00
19
+ date: 2010-11-09 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency