unscoped can take a block
This commit is contained in:
@@ -788,6 +788,12 @@ RSpec.describe HasAuxTable do
|
||||
expect(boat.only_freshwater).to eq(true)
|
||||
end
|
||||
|
||||
it "unscoped can take a block" do
|
||||
car = Car.create!(name: "Honda Civic", fuel_type: "gasoline")
|
||||
car = Car.unscoped { Car.find(car.id) }
|
||||
expect(car.fuel_type).to eq("gasoline")
|
||||
end
|
||||
|
||||
describe "namespaced models" do
|
||||
it "works with namespaced models" do
|
||||
fork1 =
|
||||
|
||||
Reference in New Issue
Block a user