Sha256: 9ca0dd7799c51aba8e9b0603107f7298e532053a908855cf11a912807430f332

Contents?: true

Size: 481 Bytes

Versions: 31

Compression:

Stored size: 481 Bytes

Contents

module RailsOps
  module ModelMixins
    module VirtualModelName
      extend ActiveSupport::Concern

      included do
        class_attribute :virtual_model_name
        class_attribute :virtual_sti_name
      end

      module ClassMethods
        def model_name
          virtual_model_name || super
        end

        def sti_name
          virtual_sti_name || super
        end

        def find_sti_class(_type_name)
          self
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
rails_ops-1.5.8 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.5.7 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.5.6 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.5.5 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.5.4 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.5.0 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.4.8 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.4.7 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.4.6 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.4.5 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.4.4 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.4.3 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.4.2 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.4.1 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.4.0 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.3.0 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.2.3 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.2.2 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.2.1 lib/rails_ops/model_mixins/virtual_model_name.rb
rails_ops-1.2.0 lib/rails_ops/model_mixins/virtual_model_name.rb