Refactor courses

This commit is contained in:
2015-09-04 13:45:37 -04:00
parent 022620e4ab
commit 6f1427dc21
25 changed files with 339 additions and 361 deletions

View File

@@ -1,21 +0,0 @@
require 'ostruct'
::App = OpenStruct.new
# Define os campos essenciais
required_fields = %w(
title
language
max_upload_file_size
default_color
)
# Carrega as configuracoes personalizadas
require "#{RAILS_ROOT}/config/application.rb"
# Verifica se todas os campos essenciais foram instanciados
required_fields.each do |field|
raise "Required configuration not found: App.#{field}" unless App.respond_to?(field)
end
# Internacionalizacao
#Gibberish.current_language = App.language if RAILS_ENV != 'test'

View File

@@ -1,21 +0,0 @@
#TzTime.zone = TZInfo::Timezone.new("America/Fortaleza")
class Time
alias :strftime_nolocale :strftime
def strftime(format)
format = format.dup
format.gsub!(/%a/, Date::ABBR_DAYNAMES[self.wday])
format.gsub!(/%A/, Date::DAYNAMES[self.wday])
format.gsub!(/%b/, Date::ABBR_MONTHNAMES[self.mon])
format.gsub!(/%B/, Date::MONTHNAMES[self.mon])
self.strftime_nolocale(format)
end
end
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(
:default => '%d/%m/%Y %H:%M',
:date_time12 => "%d/%m/%Y %I:%M%p",
:date_time24 => "%d/%m/%Y %H:%M"
)

View File

@@ -1,19 +0,0 @@
# Be sure to restart your server when you modify this file.
# These settings change the behavior of Rails 2 apps and will be defaults
# for Rails 3. You can remove this initializer when Rails 3 is released.
if defined?(ActiveRecord)
# Include Active Record class name as root for JSON serialized output.
ActiveRecord::Base.include_root_in_json = true
# Store the full class name (including module namespace) in STI type column.
ActiveRecord::Base.store_full_sti_class = true
end
# Use ISO 8601 format for JSON serialized times and dates.
ActiveSupport.use_standard_json_time_format = true
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
# if you're including raw json in an HTML page.
ActiveSupport.escape_html_entities_in_json = false