Sha256: c9c9f8b846c0b0595cbeba8b93af8e4fb0e3303a8f7f1e75c50c9439092a245f

Contents?: true

Size: 439 Bytes

Versions: 65

Compression:

Stored size: 439 Bytes

Contents

module RailsOps::ModelCasting
  def self.cast(model)
    if model.class.respond_to?(:extended_record_base_class)
      return ActiveType.cast(model, model.class.extended_record_base_class)
    else
      return model
    end
  end

  def self.original_class_for(model_class)
    if model_class.respond_to?(:extended_record_base_class)
      return model_class.extended_record_base_class
    else
      return model_class
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
rails_ops-1.0.17.1 lib/rails_ops/model_casting.rb
rails_ops-1.1.27 lib/rails_ops/model_casting.rb
rails_ops-1.1.26 lib/rails_ops/model_casting.rb
rails_ops-1.1.25 lib/rails_ops/model_casting.rb
rails_ops-1.1.24 lib/rails_ops/model_casting.rb
rails_ops-1.1.23 lib/rails_ops/model_casting.rb
rails_ops-1.1.22 lib/rails_ops/model_casting.rb
rails_ops-1.1.21 lib/rails_ops/model_casting.rb
rails_ops-1.1.20 lib/rails_ops/model_casting.rb
rails_ops-1.1.19 lib/rails_ops/model_casting.rb
rails_ops-1.1.18 lib/rails_ops/model_casting.rb
rails_ops-1.1.17 lib/rails_ops/model_casting.rb
rails_ops-1.1.16 lib/rails_ops/model_casting.rb
rails_ops-1.1.15 lib/rails_ops/model_casting.rb
rails_ops-1.1.14 lib/rails_ops/model_casting.rb
rails_ops-1.1.13 lib/rails_ops/model_casting.rb
rails_ops-1.1.12 lib/rails_ops/model_casting.rb
rails_ops-1.1.11 lib/rails_ops/model_casting.rb
rails_ops-1.1.10 lib/rails_ops/model_casting.rb
rails_ops-1.1.9 lib/rails_ops/model_casting.rb