Skip to content

Doesn't seem to work with Rails 2.3 #1

Description

@kakra

I'm having the following model:

class DistrictSection < ActiveRecord::Base
  belongs_to :district
  belongs_to :section

  validates_uniqueness_of :section_id, :scope => :district_id
  validates_presence_of   :district
  validates_presence_of   :section
  validate_on_create      :section_waste_type_not_flagged

  after_create :flag_section_with_waste_type!
  after_destroy :unflag_section_from_waste_type!

We are having an import function which produces huge amounts of this join model items and it is important not to run migrations or hooks during import. So I tried:

DistrictSection.without_callbacks :all do
  converted_district_sections = ...
  DistrictSection.create! converted_district_sections
end

But the hooks and validations are all still run. This is a Rails 2.3 application.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions