Skip to content

Change some version checks to use ActiveRecord. #804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion features/model_specs/errors_on.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: errors_on
validates_presence_of :name

# In Rails 4, mass assignment protection is implemented on controllers
attr_accessible :name if ::Rails::VERSION::STRING < '4'
attr_accessible :name if ::ActiveRecord::VERSION::STRING < '4'

validates_length_of :name, :minimum => 10, :on => :publication
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/rails/extensions/active_record/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module ActiveRecord
# ModelClass.should have(:no).records
# ModelClass.should have(1).record
# ModelClass.should have(n).records
if ::Rails::VERSION::STRING >= '4'
if ::ActiveRecord::VERSION::STRING >= '4'
def records
all.to_a
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/rails/fixture_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Rails
module FixtureSupport
extend ActiveSupport::Concern
include RSpec::Rails::SetupAndTeardownAdapter
include RSpec::Rails::MiniTestLifecycleAdapter if ::Rails::VERSION::STRING > '4'
include RSpec::Rails::MiniTestLifecycleAdapter if ::ActiveRecord::VERSION::STRING > '4'
include RSpec::Rails::TestUnitAssertionAdapter
include ActiveRecord::TestFixtures

Expand Down