Skip to content
Browse files

removed several deprecation warnings while running in Rails 2.1.1

  • Loading branch information...
1 parent 0a759b3 commit 5d4f38f9c3901bcc32b783534a5001bcb5f12bff Lawrence Karnowski committed
View
2 init.rb
@@ -1,5 +1,5 @@
if defined?(Dependencies)
- Dependencies.load_paths.unshift("#{RAILS_ROOT}/app/streamlined")
+ ActiveSupport::Dependencies.load_paths.unshift("#{RAILS_ROOT}/app/streamlined")
end
require 'extensions/array_conversions'
View
6 lib/streamlined/context/controller_context.rb
@@ -22,15 +22,15 @@ def model
end
def model_symbol
- Inflector.underscore(model_name).to_sym
+ ActiveSupport::Inflector.underscore(model_name).to_sym
end
def model_table
- Inflector.tableize(model_name)
+ ActiveSupport::Inflector.tableize(model_name)
end
def model_underscore
- Inflector.underscore(model_name)
+ ActiveSupport::Inflector.underscore(model_name)
end
def model_ui
View
2 lib/streamlined/controller.rb
@@ -81,7 +81,7 @@ def acts_as_streamlined(options = {})
include Streamlined::Controller::InstanceMethods
before_filter :initialize_request_context
Dir["#{RAILS_ROOT}/app/streamlined/*.rb"].each do |name|
- Dependencies.depend_on name, true
+ ActiveSupport::Dependencies.depend_on name, true
end
# GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :create, :update ],
View
4 lib/streamlined/controller/crud_methods.rb
@@ -38,7 +38,7 @@ def list
end
self.instance_variable_set("@#{model_name.variableize}_pages", model_pages)
- self.instance_variable_set("@#{Inflector.tableize(model_name)}", models)
+ self.instance_variable_set("@#{ActiveSupport::Inflector.tableize(model_name)}", models)
@streamlined_items = models
@streamlined_item_pages = model_pages
find_columns_for_export if exporting
@@ -181,7 +181,7 @@ def export_xml
def export_xml_file
@xml_file = true
headers["Content-Type"] = "text/xml"
- headers["Content-Disposition"] = "attachment; filename=\"#{Inflector.tableize(model_name)}_#{Time.now.strftime('%Y%m%d')}.xml\""
+ headers["Content-Disposition"] = "attachment; filename=\"#{ActiveSupport::Inflector.tableize(model_name)}_#{Time.now.strftime('%Y%m%d')}.xml\""
render_streamlined_file '/generic_views/list.rxml', :layout => false
end
View
4 lib/streamlined/helpers/filter_helper.rb
@@ -16,7 +16,7 @@ def advanced_filter_columns
if model_ui.column(association_name, :crud_context => :list).show_view.fields
model_ui.column(association_name, :crud_context => :list).show_view.fields.each do |field|
if model.reflect_on_association(association_name).klass.column_names.index(field.to_s)
- filter_columns[Inflector.humanize(association_name.to_s) + " (" + Inflector.humanize(field) + ")"] = "rel::" + association_name.to_s + "::" + "#{field}"
+ filter_columns[ActiveSupport::Inflector.humanize(association_name.to_s) + " (" + ActiveSupport::Inflector.humanize(field) + ")"] = "rel::" + association_name.to_s + "::" + "#{field}"
end
end
else
@@ -24,7 +24,7 @@ def advanced_filter_columns
no_name_yet = true
names.each do |name|
if no_name_yet && model.reflect_on_association(association_name).klass.column_names.index(name)
- filter_columns[Inflector.humanize(association_name.to_s) + " (" + Inflector.humanize(name) + ")"] = "rel::" + association_name.to_s + "::" + "#{name}"
+ filter_columns[ActiveSupport::Inflector.humanize(association_name.to_s) + " (" + ActiveSupport::Inflector.humanize(name) + ")"] = "rel::" + association_name.to_s + "::" + "#{name}"
no_name_yet = false
end
end
View
4 lib/streamlined/view/base.rb
@@ -19,13 +19,13 @@ def initialize(options = {})
# Returns the string representation used to create JavaScript IDs for this relationship type.
# Fragile: might be a problem with modules or anonymous subclasses
def id_fragment
- return Inflector.demodulize(self.class.name)
+ return ActiveSupport::Inflector.demodulize(self.class.name)
end
# Returns the path to the partial that will be used to render this relationship type.
def partial
mod = self.class.name.split("::")[-2]
- partial_name = Inflector.underscore(Inflector.demodulize(self.class.name))
+ partial_name = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(self.class.name))
File.join(STREAMLINED_TEMPLATE_ROOT, "relationships/#{mod.underscore}/_#{partial_name}.rhtml")
end
View
2 lib/streamlined/view/edit_views.rb
@@ -1,7 +1,7 @@
module Streamlined::View::EditViews
def self.create_relationship(sym, options = {})
raise ArgumentError unless Symbol === sym
- Class.class_eval(Inflector.camelize(sym.to_s)).new options
+ Class.class_eval(ActiveSupport::Inflector.camelize(sym.to_s)).new options
end
# Factory method for creating a relationship View given the name of a view.
View
2 lib/streamlined/view/show_views.rb
@@ -3,7 +3,7 @@ module Streamlined::View::ShowViews
# Factory method for creating a relationship Summary given the name of a summary.
def self.create_summary(sym, options = {})
raise ArgumentError unless Symbol === sym
- Class.class_eval(Inflector.camelize(sym.to_s)).new options
+ Class.class_eval(ActiveSupport::Inflector.camelize(sym.to_s)).new options
end
# TODO: this is not very dry!
View
2 templates/generic_views/_show_export.html.erb
@@ -9,7 +9,7 @@
<p>
<% if show_columns_to_export -%>
<% model_ui.list_columns.each do |column| -%>
- <%= content_tag(:label, check_box_tag("export_columns[#{column.name}]", 1, !export_config.default_deselected_column?(column.name.to_sym)) + "&nbsp;#{Inflector.humanize(column.name)}") %>
+ <%= content_tag(:label, check_box_tag("export_columns[#{column.name}]", 1, !export_config.default_deselected_column?(column.name.to_sym)) + "&nbsp;#{ActiveSupport::Inflector.humanize(column.name)}") %>
<% end -%>
<% end -%>
</p>
View
2 templates/generic_views/_show_export.rhtml
@@ -9,7 +9,7 @@
<p>
<% if show_columns_to_export -%>
<% model_ui.list_columns.each do |column| -%>
- <%= content_tag(:label, check_box_tag("export_columns[#{column.name}]", 1, !export_config.default_deselected_column?(column.name.to_sym)) + "&nbsp;#{Inflector.humanize(column.name)}") %>
+ <%= content_tag(:label, check_box_tag("export_columns[#{column.name}]", 1, !export_config.default_deselected_column?(column.name.to_sym)) + "&nbsp;#{ActiveSupport::Inflector.humanize(column.name)}") %>
<% end -%>
<% end -%>
</p>
View
2 templates/generic_views/list.rxml
@@ -1,7 +1,7 @@
xml.instruct!
xml.instruct! :"xml-stylesheet", :type => "text/xsl", :href => "#{model_underscore}.xsl" if @xml_file
-xml.tag! Inflector.pluralize(model_name) do
+xml.tag! ActiveSupport::Inflector.pluralize(model_name) do
for item in @streamlined_items
xml.tag! model_name do
# model columns
View
6 templates/generic_views/stylesheet.rxml
@@ -4,16 +4,16 @@ xml.tag! :"xsl:stylesheet", :version => "1.0", :"xmlns:xsl" => "http://www.w3.or
xml.tag! :"xsl:template", :match => "/" do
xml.tag! "html" do
xml.tag! "body" do
- xml.tag! "h2", Inflector.pluralize(model_name)
+ xml.tag! "h2", ActiveSupport::Inflector.pluralize(model_name)
xml.tag! "table", :border => "1" do
xml.tag! "tr", :bgcolor => "#9acd32" do
@export_columns.each do |column|
xml.tag! "th", :align=>"left" do
- xml.text! "#{Inflector.humanize(column.name)}"
+ xml.text! "#{ActiveSupport::Inflector.humanize(column.name)}"
end
end
end
- xml.tag! "xsl:for-each", :select => "#{Inflector.pluralize(model_name)}/#{model_name}" do
+ xml.tag! "xsl:for-each", :select => "#{ActiveSupport::Inflector.pluralize(model_name)}/#{model_name}" do
xml.tag! "tr" do
@export_columns.each do |column|
xml.tag! "td" do
View
4 vendor/plugins/classic_pagination/lib/pagination.rb
@@ -97,8 +97,8 @@ def self.validate_options!(collection_id, options, in_action) #:nodoc:
"Unknown options: #{unknown_option_keys.join(', ')}" unless
unknown_option_keys.empty?
- options[:singular_name] ||= Inflector.singularize(collection_id.to_s)
- options[:class_name] ||= Inflector.camelize(options[:singular_name])
+ options[:singular_name] ||= ActiveSupport::Inflector.singularize(collection_id.to_s)
+ options[:class_name] ||= ActiveSupport::Inflector.camelize(options[:singular_name])
end
# Returns a paginator and a collection of Active Record model instances

0 comments on commit 5d4f38f

Please sign in to comment.
Something went wrong with that request. Please try again.