class Shoulda::Matchers::RailsShim
@private
Public Class Methods
action_pack_major_version()
click to toggle source
# File lib/shoulda/matchers/rails_shim.rb, line 45 def self.action_pack_major_version ::ActionPack::VERSION::MAJOR end
active_model_major_version()
click to toggle source
# File lib/shoulda/matchers/rails_shim.rb, line 41 def self.active_model_major_version ::ActiveModel::VERSION::MAJOR end
active_record_major_version()
click to toggle source
# File lib/shoulda/matchers/rails_shim.rb, line 37 def self.active_record_major_version ::ActiveRecord::VERSION::MAJOR end
clean_scope(klass)
click to toggle source
# File lib/shoulda/matchers/rails_shim.rb, line 21 def self.clean_scope(klass) if active_record_major_version == 4 klass.all else klass.scoped end end
flashes_ivar()
click to toggle source
# File lib/shoulda/matchers/rails_shim.rb, line 13 def self.flashes_ivar if action_pack_major_version >= 4 :@flashes else :@used end end
layouts_ivar()
click to toggle source
# File lib/shoulda/matchers/rails_shim.rb, line 5 def self.layouts_ivar if action_pack_major_version >= 4 '@_layouts' else '@layouts' end end
validates_confirmation_of_error_attribute(matcher)
click to toggle source
# File lib/shoulda/matchers/rails_shim.rb, line 29 def self.validates_confirmation_of_error_attribute(matcher) if active_model_major_version == 4 matcher.confirmation_attribute else matcher.attribute end end