Class: NeetoCommonsBackend::SampleData::Common::Base
- Inherits:
-
Object
- Object
- NeetoCommonsBackend::SampleData::Common::Base
show all
- Defined in:
- app/services/neeto_commons_backend/sample_data/common/base.rb
Instance Method Summary
collapse
Instance Method Details
#admin ⇒ Object
13
14
15
|
# File 'app/services/neeto_commons_backend/sample_data/common/base.rb', line 13
def admin
organization.users.find_by(email: "[email protected]")
end
|
#app_secrets ⇒ Object
37
38
39
|
# File 'app/services/neeto_commons_backend/sample_data/common/base.rb', line 37
def app_secrets
@_app_secrets ||= Rails.application.secrets
end
|
#description ⇒ Object
29
30
31
|
# File 'app/services/neeto_commons_backend/sample_data/common/base.rb', line 29
def description
self.class.name
end
|
#heroku_or_development_env? ⇒ Boolean
33
34
35
|
# File 'app/services/neeto_commons_backend/sample_data/common/base.rb', line 33
def heroku_or_development_env?
Rails.env.heroku? || Rails.env.development?
end
|
#load! ⇒ Object
41
42
43
44
45
|
# File 'app/services/neeto_commons_backend/sample_data/common/base.rb', line 41
def load!
print_description
process!
print_success
end
|
#organization ⇒ Object
9
10
11
|
# File 'app/services/neeto_commons_backend/sample_data/common/base.rb', line 9
def organization
@_organization ||= Organization.find_by(subdomain: "spinkart")
end
|
#print_description ⇒ Object
21
22
23
|
# File 'app/services/neeto_commons_backend/sample_data/common/base.rb', line 21
def print_description
Rails.logger.debug format("%-80s", description)
end
|
#print_success ⇒ Object
25
26
27
|
# File 'app/services/neeto_commons_backend/sample_data/common/base.rb', line 25
def print_success
Rails.logger.debug "[DONE]\n"
end
|
#skip? ⇒ Boolean
17
18
19
|
# File 'app/services/neeto_commons_backend/sample_data/common/base.rb', line 17
def skip?
!heroku_or_development_env?
end
|