1.8.7 compartible csv parsing
Oleg
committed Jan 06, 2012
commit 110ba738eb98af3d2c34e1d3404f6198dc4c433c
Showing 2
changed files with
3 additions
and 4 deletions
app/controllers/cms_content_controller.rb
+2
-2
| @@ | @@ -3,8 +3,8 @@ class CmsContentController < ApplicationController |
| # Authentication module must have #authenticate method | |
| include ComfortableMexicanSofa.config.public_auth.to_s.constantize | |
| - | before_filter :load_cms_site |
| - | before_filter :load_fixtures |
| + | before_filter :load_cms_site, |
| + | :load_fixtures |
| before_filter :load_cms_page, :authenticate, | |
| :only => :render_html | |
| before_filter :load_cms_layout, | |
comfortable_mexican_sofa/tag.rb b/lib/comfortable_mexican_sofa/tag.rb
+1
-2
| @@ | @@ -1,6 +1,5 @@ |
| # encoding: utf-8 | |
| - | # used for parsing tags |
| require 'csv' | |
| # This module provides all Tag classes with neccessary methods. | |
| @@ | @@ -35,7 +34,7 @@ module ComfortableMexicanSofa::Tag |
| tag = self.new | |
| tag.page = page | |
| tag.identifier = match[1] | |
| - | tag.params = match[2].to_s.parse_csv(:col_sep => ':') || [] |
| + | tag.params = CSV.parse_line(match[2].to_s, (RUBY_VERSION < '1.9.2' ? ':' : {:col_sep => ':'})) || [] |
| tag | |
| end | |
| end | |