Module: TrickSerial::Serializer::Rails

Defined in:
lib/trick_serial/serializer/rails.rb

Defined Under Namespace

Modules: V12, V3

Class Method Summary collapse

Class Method Details

.activate!Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/trick_serial/serializer/rails.rb', line 6

def self.activate!
  rails_version = 
    (Rails.version rescue nil) ||
    (RAILS_VERSION rescue nil) || :unknown
  case rails_version
  when /^3\./
    V3
  when /^1\.2\./
    V12
  else
    raise ArgumentError, "#{self}: Unknown Rails version: #{rails_version.inspect}"
  end.activate!
end