diff --git a/Rakefile b/Rakefile index d6d4f6f00..48cd68e17 100644 --- a/Rakefile +++ b/Rakefile @@ -60,7 +60,7 @@ end desc "Clean pkg and other stuff" task :uninstall do - sh "gem search --no-version padrino | grep padrino | xargs gem uninstall -a" + sudo_sh "gem search --no-version padrino | grep padrino | xargs gem uninstall -a" end desc "Displays the current version" diff --git a/padrino-admin/lib/padrino-admin/generators/orm.rb b/padrino-admin/lib/padrino-admin/generators/orm.rb index 13e944f68..c70ee3548 100644 --- a/padrino-admin/lib/padrino-admin/generators/orm.rb +++ b/padrino-admin/lib/padrino-admin/generators/orm.rb @@ -7,14 +7,14 @@ class Orm def initialize(name, orm, columns=nil, column_fields=nil) name = name.to_s - @klass_name = name.classify - @klass = name.classify.constantize rescue nil + @klass_name = name.camelize + @klass = @klass_name.constantize rescue nil @name_plural = name.underscore.pluralize @name_singular = name.underscore @orm = orm.to_sym @columns = columns @column_fields = column_fields - raise OrmError, "Model '#{name}' could not be found!" if @columns.nil? && @klass.nil? + raise OrmError, "Model '#{klass_name}' could not be found!" if @columns.nil? && @klass.nil? end def field_type(type)