Module: ActiveTree

Defined in:
lib/active_tree.rb,
lib/active_tree/version.rb,
lib/generators/active_tree/install_generator.rb,
lib/active_tree/models/concerns/active_tree_able.rb

Overview

Defined Under Namespace

Modules: ActiveTreeAble, Generators, Statusable Classes: Builder, Error, Metadata, Model, ModelQuery, Query, Store

Constant Summary collapse

VERSION =
"0.3.3"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.active_tree_modelsObject

Returns the value of attribute active_tree_models.



29
30
31
# File 'lib/active_tree.rb', line 29

def active_tree_models
  @active_tree_models
end

.optionsObject

Returns the value of attribute options.



30
31
32
# File 'lib/active_tree.rb', line 30

def options
  @options
end

Class Method Details

.active_tree_optionsObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/active_tree.rb', line 35

def self.active_tree_options
 @options ||= begin
	    path = Rails.root.join("config", "active_tree.yml").to_s
	    if File.exist?(path)
		    YAML.load(ERB.new(File.read(path)).result)
	    else
    		{
    		    table_name: "active_tree_models",
    		    jwt_secret: "",
    		    jwt_encryption: "HS256"
    		}
	    end
	end
end

.envObject



50
51
52
# File 'lib/active_tree.rb', line 50

def self.env
    @env ||= ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"
end