Skip to content

Commit

Permalink
removed code
Browse files Browse the repository at this point in the history
  • Loading branch information
Duke committed Mar 25, 2012
1 parent a709032 commit 30ffa16
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 51 deletions.
11 changes: 0 additions & 11 deletions lib/utopia/resource/controllers.rb
Expand Up @@ -12,17 +12,6 @@ def controller_name
def controller
@controller ||= controller_name.constantize
end

# Returns a symbol for the route to use to get to the
# collection of this resource
def route_collection_path
#route = [
# controller.resources_configuration[:self][:route_collection_name],
# 'path'
#]

#route.compact.join('_').to_sym
end
end
end
end
50 changes: 10 additions & 40 deletions lib/utopia/resource/naming.rb
Expand Up @@ -20,60 +20,30 @@ def resource_label
if @options[:as]
@options[:as]
else
resource_name.human(:default => resource_name.gsub('::', ' ')).titleize
end
end
resource_name.human(:default => resource_name.gsub('::', ' ')).titleize
end
end

def plural_resource_label
if @options[:as]
#@options[:as].pluralize
else
resource_name.human(:count => 3, :default => resource_label.pluralize).titleize
end
def plural_resource_label
if @options[:as]
@options[:as].pluralize
else
resource_name.human(:count => 3, :default => resource_label.pluralize).titleize
end
end
end

# A subclass of ActiveModel::Name which supports the different APIs presented
# in Rails < 3.1 and > 3.1.
class Name < ActiveModel::Name

def initialize(klass, name = nil)
if ActiveModel::Name.instance_method(:initialize).arity == 1
#super(proxy_for_initializer(klass, name))
else
super(klass, nil, name)
end
end

def proxy_for_initializer(klass, name)
#return klass unless name
#return StringClassProxy.new(klass, name) if klass

#StringProxy.new(name)
super(klass, nil, name)
end

def route_key
plural
end

class StringProxy
def initialize(name)
#@name = name
end

def name
#@name
end
end

class StringClassProxy < StringProxy
# delegate :lookup_ancestors, :i18n_scope, :to => :"@klass"

def initialize(klass, name)
#@klass = klass || name
#super(name)
end
end
end
end
end

0 comments on commit 30ffa16

Please sign in to comment.