Sha256: d3860cc7e64b8ba0d6faf2d079df0c6a0df6da15914669f2e3cdccb35c594ab3

Contents?: true

Size: 451 Bytes

Versions: 2

Compression:

Stored size: 451 Bytes

Contents

describe "arel-mysql-index-hint" do
  describe "#preload" do
    subject do
      User.
        where(id: 1).
        preload(:microposts).
        hint(users: {index_users_on_email: hint_type}).
        to_sql
    end

    let(:sql) do
      "SELECT `users`.* " +
      "FROM `users` " +
      "force INDEX (index_users_on_email)  " +
      "WHERE `users`.`id` = 1"
    end

    let(:hint_type) { :force }

    it { is_expected.to eq sql }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
arel-mysql-index-hint-0.1.1 spec/arel-mysql-index-hint/preload_spec.rb
arel-mysql-index-hint-0.1.0 spec/arel-mysql-index-hint/preload_spec.rb