Skip to content

Commit c82602b

Browse files
committed
#all is the preferred way to get a relation in Rails 4
1 parent c26ac93 commit c82602b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

features/matchers/relation_match_array.feature

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ Feature: ActiveRecord::Relation match array
1111
1212
describe Widget do
1313
let!(:widgets) { Array.new(3) { Widget.create } }
14-
subject { Widget.scoped }
14+
15+
if ::Rails::VERSION::STRING >= '4'
16+
subject { Widget.all }
17+
else
18+
subject { Widget.scoped }
19+
end
1520
1621
it "returns all widgets in any order" do
1722
expect(subject).to match_array(widgets)

0 commit comments

Comments
 (0)