Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 9126

Show
Ignore:
Timestamp:
03/28/08 22:14:04 (2 months ago)
Author:
david
Message:

Fix new migration versions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_view/helpers/active_record_helper.rb

    r8968 r9126  
    204204      alias_method :tag_without_error_wrapping, :tag 
    205205      def tag(name, options) 
    206         if object.respond_to?("errors") && object.errors.respond_to?("on") 
    207           error_wrapping(tag_without_error_wrapping(name, options), object.errors.on(@method_name)) 
     206        if object.respond_to?("errors") && object.errors.respond_to?("on") && object.errors.on(@method_name) 
     207          # error_wrapping(tag_without_error_wrapping(name, options), object.errors.on(@method_name)) 
     208          tag_without_error_wrapping(name, options.merge({ "class" => options["class"] ? "#{options["class"]} errors" : 'errors' })) 
    208209        else 
    209210          tag_without_error_wrapping(name, options) 
     
    213214      alias_method :content_tag_without_error_wrapping, :content_tag 
    214215      def content_tag(name, value, options) 
    215         if object.respond_to?("errors") && object.errors.respond_to?("on") 
    216           error_wrapping(content_tag_without_error_wrapping(name, value, options), object.errors.on(@method_name)) 
     216        if object.respond_to?("errors") && object.errors.respond_to?("on") && object.errors.on(@method_name) 
     217          # error_wrapping(content_tag_without_error_wrapping(name, value, options), object.errors.on(@method_name)) 
     218          content_tag_without_error_wrapping(name, value, options.merge({ "class" => options["class"] ? "#{options["class"]} errors" : 'errors' })) 
    217219        else 
    218220          content_tag_without_error_wrapping(name, value, options) 
  • trunk/activerecord/lib/active_record/migration.rb

    r9122 r9126  
    344344       
    345345      def run(direction, migrations_path, target_version) 
    346         self.new(direction, migrations_path, target_version) 
     346        self.new(direction, migrations_path, target_version).run 
    347347      end 
    348348 
  • trunk/railties/lib/tasks/databases.rake

    r9122 r9126  
    105105      raise "VERSION is required" unless version 
    106106      ActiveRecord::Migrator.run(:up, "db/migrate/", version) 
     107      Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby 
    107108    end 
    108109 
     
    112113      raise "VERSION is required" unless version 
    113114      ActiveRecord::Migrator.run(:down, "db/migrate/", version) 
     115      Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby 
    114116    end     
    115117  end 
     
    119121    step = ENV['STEP'] ? ENV['STEP'].to_i : 1 
    120122    ActiveRecord::Migrator.rollback('db/migrate/', step) 
     123    Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby 
    121124  end 
    122125