Sha256: 6c98652ba9169ef36b1543c6c911c89c28d3d90f2e347cddae4b23bd6d1fd927

Contents?: true

Size: 779 Bytes

Versions: 1

Compression:

Stored size: 779 Bytes

Contents

require 'calculated_attributes/version'
require 'active_record'

# Include patches.
require 'calculated_attributes/rails_patches'
require 'calculated_attributes/arel_patches'
raise "Unsupported ActiveRecord version: #{ActiveRecord::VERSION::MAJOR}" unless [3, 4, 5, 6].include? ActiveRecord::VERSION::MAJOR

# Rails 5.2 has its own patches which are different from 5.0. In every other
# case, just require the patch file for the major version.
versions = Gem::Version.new(ActiveRecord::VERSION::STRING).canonical_segments.take(2)
if [[5, 2], [5, 1]].include?(versions)
  require 'calculated_attributes/rails_5_2_patches'
else
  require "calculated_attributes/rails_#{ActiveRecord::VERSION::MAJOR}_patches"
end

# Include model code.
require 'calculated_attributes/model_methods'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
calculated_attributes-0.5.0 lib/calculated_attributes.rb