Sha256: 42b936b1429cc5f760c356fd6cc00d067848e47a8c4befa518e3192c96cf0fd3
Contents?: true
Size: 559 Bytes
Versions: 15
Compression:
Stored size: 559 Bytes
Contents
module Impressionist # Responsibility # Toggles between rails > 3.1 < 4 # In order to make attr_accessible available in a rails app < 4 class RailsToggle # decides where or not to include attr_accessible def should_include? supported_by_rails? && (not using_strong_parameters?) end private def using_strong_parameters? defined?(StrongParameters) end # returns false if rails >= 4 # true if rails < 4 def supported_by_rails? ::Rails::VERSION::MAJOR.to_i < 4 end end end
Version data entries
15 entries across 15 versions & 3 rubygems