Class: ContentBlock
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ContentBlock
- Defined in:
- app/models/content_block.rb
Constant Summary collapse
- MARKETING =
'marketing_text'
- RESEARCHER =
'featured_researcher'
- ANNOUNCEMENT =
'announcement_text'
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.external_keys ⇒ Object
14 15 16 |
# File 'app/models/content_block.rb', line 14 def self.external_keys { RESEARCHER => 'User' } end |
.featured_researcher ⇒ Object
10 11 12 |
# File 'app/models/content_block.rb', line 10 def self.featured_researcher recent_researchers.first end |
.recent_researchers ⇒ Object
6 7 8 |
# File 'app/models/content_block.rb', line 6 def self.recent_researchers where(name: RESEARCHER).order('created_at DESC') end |
Instance Method Details
#external_key_name ⇒ Object
18 19 20 |
# File 'app/models/content_block.rb', line 18 def external_key_name self.class.external_keys.fetch(name) { 'External Key' } end |