Giter Site home page Giter Site logo

Comments (3)

djezzzl avatar djezzzl commented on June 12, 2024

I agree with you and it seems it works fine for me.

I've checked rails6-example folder and I see this:

ColumnPresenceChecker fail User country association foreign key column should be required in the database

I also see this spec:

context 'when null constraint is missing for the association key' do
    before do
      define_database_with_entity { |table| table.string :user_id }
    end

    let(:attribute) { :user }

    context 'when `belongs_to` is required' do
      let(:klass) { define_class { |klass| klass.belongs_to :user, **required } }

      specify do
        expect(checker.report).to have_attributes(
          checker_name: 'ColumnPresenceChecker',
          table_or_model_name: klass.name,
          column_or_attribute_name: 'user',
          status: :fail,
          error_message: nil,
          error_slug: :association_missing_null_constraint
        )
      end
    end

    context 'when `belongs_to` is optional' do
      let(:klass) { define_class { |klass| klass.belongs_to :user, **optional } }

      specify do
        expect(checker.report).to be_nil
      end
    end
  end

Please let me know if it doesn't work for you, I would gladly fix it. Feel free to reopen an issue.

from database_consistency.

toydestroyer avatar toydestroyer commented on June 12, 2024

I could swear it wasn't working yesterday on my machine 😂
Sorry about this! I will be more careful next time before opening an issue.

from database_consistency.

djezzzl avatar djezzzl commented on June 12, 2024

No need to apologize! Thank you for keeping a sharp eye on any issues!

from database_consistency.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.