From bcf5fea5e5a22edd5c7b27c29a53de0a4bedbc27 Mon Sep 17 00:00:00 2001 From: Adrian Sanchez Date: Wed, 5 May 2010 01:39:59 -0500 Subject: Bundler deprecated options in Gemfile with application template using method "gem" [#4534 state:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- railties/lib/rails/generators/actions.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb index a31932906d..7af329bbf0 100644 --- a/railties/lib/rails/generators/actions.rb +++ b/railties/lib/rails/generators/actions.rb @@ -54,7 +54,8 @@ module Rails name, version = args # Deal with deprecated options - { :env => :only, :lib => :require_as }.each do |old, new| + { :env => :group, :only => :group, + :lib => :require, :require_as => :require }.each do |old, new| next unless options[old] options[new] = options.delete(old) ActiveSupport::Deprecation.warn "#{old.inspect} option in gem is deprecated, use #{new.inspect} instead" -- cgit v1.2.3 From 4750e61bfecd210e5c4d96546d638b5cd23bb09e Mon Sep 17 00:00:00 2001 From: Jeff Kreeftmeijer Date: Fri, 14 May 2010 22:14:49 +0200 Subject: using :time_select when the attribute type is :time in the scaffold generator. [#2377 state:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- railties/lib/rails/generators/generated_attribute.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb index e962308585..f01934f946 100644 --- a/railties/lib/rails/generators/generated_attribute.rb +++ b/railties/lib/rails/generators/generated_attribute.rb @@ -9,12 +9,13 @@ module Rails def field_type @field_type ||= case type - when :integer, :float, :decimal then :text_field - when :datetime, :timestamp, :time then :datetime_select - when :date then :date_select - when :string then :text_field - when :text then :text_area - when :boolean then :check_box + when :integer, :float, :decimal then :text_field + when :time then :time_select + when :datetime, :timestamp then :datetime_select + when :date then :date_select + when :string then :text_field + when :text then :text_area + when :boolean then :check_box else :text_field end -- cgit v1.2.3 From 5ff6de0982c165bb9038258d867398c73c142084 Mon Sep 17 00:00:00 2001 From: Jeff Kreeftmeijer Date: Sun, 16 May 2010 11:20:11 +0200 Subject: Added assert_attribute_type to clean up GeneratedAttributeTest [#2377 state:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- railties/lib/rails/generators/test_case.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/test_case.rb b/railties/lib/rails/generators/test_case.rb index 6b97c69d8d..24b57aabf9 100644 --- a/railties/lib/rails/generators/test_case.rb +++ b/railties/lib/rails/generators/test_case.rb @@ -189,6 +189,18 @@ module Rails end alias :assert_method :assert_instance_method + # Asserts the given field name gets translated to an attribute type + # properly. + # + # assert_attribute_type 'date', :date_select + # + def assert_attribute_type(name, attribute_type) + assert_equal( + Rails::Generators::GeneratedAttribute.new('test', name).field_type, + attribute_type + ) + end + # Runs the generator configured for this class. The first argument is an array like # command line arguments: # -- cgit v1.2.3 From 1a2d556de7935588e04c541e6c0804b5533db6b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 16 May 2010 12:07:44 +0200 Subject: Rename assert_attribute_type to asser_field_type. --- railties/lib/rails/generators/test_case.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/test_case.rb b/railties/lib/rails/generators/test_case.rb index 24b57aabf9..952400e049 100644 --- a/railties/lib/rails/generators/test_case.rb +++ b/railties/lib/rails/generators/test_case.rb @@ -192,11 +192,11 @@ module Rails # Asserts the given field name gets translated to an attribute type # properly. # - # assert_attribute_type 'date', :date_select + # assert_field_type :date, :date_select # - def assert_attribute_type(name, attribute_type) + def assert_field_type(name, attribute_type) assert_equal( - Rails::Generators::GeneratedAttribute.new('test', name).field_type, + Rails::Generators::GeneratedAttribute.new('test', name.to_s).field_type, attribute_type ) end -- cgit v1.2.3 From b7bdacf1abb71ec2b46ea54893fb881dea36cca8 Mon Sep 17 00:00:00 2001 From: Aleksandr Koss Date: Sun, 16 May 2010 17:52:25 +0100 Subject: Added rails command aliases (s g c db) to reserved words in app generator [#4602 state:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- railties/lib/rails/generators/rails/app/app_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails/generators') diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 0a0b033738..ee44acc2fa 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -149,7 +149,7 @@ module Rails # can change in Ruby 1.8.7 when we FileUtils.cd. RAILS_DEV_PATH = File.expand_path("../../../../../..", File.dirname(__FILE__)) - RESERVED_NAMES = %w[generate console server dbconsole + RESERVED_NAMES = %w[generate g console c server s dbconsole db application destroy benchmarker profiler plugin runner test] -- cgit v1.2.3