Sha256: 7ba17f2eb14d07459d2d27fa4df152ef4c1cb9f5b48b0746b4b190af4517746f
Contents?: true
Size: 648 Bytes
Versions: 23
Compression:
Stored size: 648 Bytes
Contents
require File.expand_path("../../spec_helper", __FILE__) require "active_support/core_ext" describe "Chaining scopes together" do describe "then calling #all" do before do User.all(:name => "Quagmire").each { |q| q.destroy } @users = (0...10).map do |i| User.create :name => "Quagmire", :created_at => i.hours.ago end end it "queries using a combination of both scopes" do User.named_quagmire.recent.all.should == @users.slice(0, 3) end it "gives scopes on the right priority" do User.named_joe.named_quagmire.first.name.should == "Quagmire" end end end
Version data entries
23 entries across 23 versions & 7 rubygems