Sha256: 8caadef14386ac994a3a5a65bdea5e243f0bb830547abd100e40fb297a15209b

Contents?: true

Size: 976 Bytes

Versions: 21

Compression:

Stored size: 976 Bytes

Contents

# frozen_string_literal: true

require "faker"

module NeetoCommonsBackend
  module SampleData
    module Common
      class Base
        def organization
          @_organization ||= Organization.find_by(subdomain: "spinkart")
        end

        def admin
          organization.users.find_by(email: "oliver@example.com")
        end

        def skip?
          !heroku_or_development_env?
        end

        def print_description
          Rails.logger.debug format("%-80s", description)
        end

        def print_success
          Rails.logger.debug "[DONE]\n"
        end

        def description
          self.class.name
        end

        def heroku_or_development_env?
          Rails.env.heroku? || Rails.env.development?
        end

        def app_secrets
          @_app_secrets ||= Rails.application.secrets
        end

        def load!
          print_description
          process!
          print_success
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
neeto-commons-backend-1.0.109 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.108 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.107 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.106 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.105 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.104 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.103 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.102 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.101 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.100 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.99 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.98 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.97 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.96 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.95 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.94 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.93 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.92 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.91 app/services/neeto_commons_backend/sample_data/common/base.rb
neeto-commons-backend-1.0.90 app/services/neeto_commons_backend/sample_data/common/base.rb