Sha256: c9541382ca48ccd7e5f01142c9076f2d17d6669f8476babc2b5e8a695d41b2f4

Contents?: true

Size: 863 Bytes

Versions: 6

Compression:

Stored size: 863 Bytes

Contents

module Faalis
  module Generators
    module Concerns
      # This **concern** adds support for `model` key inside jsonfile which
      # allow you to override the name of resource default model name.
      # Resource model name is used in some processes like permission system.
      module Model

        def self.included(base)
          # Fields to use in in bulk edit, comma separated
          #base.class_option :model, :type => :string, :default => "", :desc => "Model name to use"

        end

        private

        # Does an alternative `model` is specified ?
        def model_specified?
          resource_data.include? "model"
        end

        # Name of alternative `model`
        def model
          if model_specified?
            resource_data["model"]
          else
            ""
          end
        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
faalis-0.24.2 lib/faalis/generators/concerns/model.rb
faalis-0.24.0 lib/faalis/generators/concerns/model.rb
faalis-0.23.0 lib/faalis/generators/concerns/model.rb
faalis-0.22.0 lib/faalis/generators/concerns/model.rb
faalis-0.21.1 lib/faalis/generators/concerns/model.rb
faalis-0.21.0 lib/faalis/generators/concerns/model.rb