Skip to content

Commit

Permalink
Merge pull request rails#3359 from mrreynolds/datamapper_naming_fix
Browse files Browse the repository at this point in the history
Fixed DataMapper namings in symbols and constants.
  • Loading branch information
rafaelfranca committed May 19, 2012
2 parents 26bdcf7 + 8d3cd53 commit 6df96c9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion railties/lib/rails/engine/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def middleware
# Holds generators configuration:
#
# config.generators do |g|
# g.orm :datamapper, :migration => true
# g.orm :data_mapper, :migration => true
# g.template_engine :haml
# g.test_framework :rspec
# end
Expand Down
2 changes: 1 addition & 1 deletion railties/lib/rails/generators/active_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Generators
# ActiveRecord::Generators::ActiveModel.find(Foo, "params[:id]")
# # => "Foo.find(params[:id])"
#
# Datamapper::Generators::ActiveModel.find(Foo, "params[:id]")
# DataMapper::Generators::ActiveModel.find(Foo, "params[:id]")
# # => "Foo.get(params[:id])"
#
# On initialization, the ActiveModel accepts the instance name that will
Expand Down
18 changes: 9 additions & 9 deletions railties/test/application/generators_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def with_bare_config

test "generators set rails options" do
with_bare_config do |c|
c.generators.orm = :datamapper
c.generators.orm = :data_mapper
c.generators.test_framework = :rspec
c.generators.helper = false
expected = { :rails => { :orm => :datamapper, :test_framework => :rspec, :helper => false } }
expected = { :rails => { :orm => :data_mapper, :test_framework => :rspec, :helper => false } }
assert_equal(expected, c.generators.options)
end
end
Expand All @@ -64,7 +64,7 @@ def with_bare_config
test "generators aliases, options, templates and fallbacks on initialization" do
add_to_config <<-RUBY
config.generators.rails :aliases => { :test_framework => "-w" }
config.generators.orm :datamapper
config.generators.orm :data_mapper
config.generators.test_framework :rspec
config.generators.fallbacks[:shoulda] = :test_unit
config.generators.templates << "some/where"
Expand Down Expand Up @@ -95,15 +95,15 @@ def with_bare_config
test "generators with hashes for options and aliases" do
with_bare_config do |c|
c.generators do |g|
g.orm :datamapper, :migration => false
g.orm :data_mapper, :migration => false
g.plugin :aliases => { :generator => "-g" },
:generator => true
end

expected = {
:rails => { :orm => :datamapper },
:rails => { :orm => :data_mapper },
:plugin => { :generator => true },
:datamapper => { :migration => false }
:data_mapper => { :migration => false }
}

assert_equal expected, c.generators.options
Expand All @@ -114,12 +114,12 @@ def with_bare_config
test "generators with string and hash for options should generate symbol keys" do
with_bare_config do |c|
c.generators do |g|
g.orm 'datamapper', :migration => false
g.orm 'data_mapper', :migration => false
end

expected = {
:rails => { :orm => :datamapper },
:datamapper => { :migration => false }
:rails => { :orm => :data_mapper },
:data_mapper => { :migration => false }
}

assert_equal expected, c.generators.options
Expand Down
4 changes: 2 additions & 2 deletions railties/test/railties/engine_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ class Engine < ::Rails::Engine
module Bukkits
class Engine < ::Rails::Engine
config.generators do |g|
g.orm :datamapper
g.orm :data_mapper
g.template_engine :haml
g.test_framework :rspec
end
Expand Down Expand Up @@ -910,7 +910,7 @@ class Engine < ::Rails::Engine
assert_equal :test_unit, app_generators[:test_framework]

generators = Bukkits::Engine.config.generators.options[:rails]
assert_equal :datamapper, generators[:orm]
assert_equal :data_mapper, generators[:orm]
assert_equal :haml , generators[:template_engine]
assert_equal :rspec , generators[:test_framework]
end
Expand Down

0 comments on commit 6df96c9

Please sign in to comment.