Class: Qbrick::PlaceholderBrick

Inherits:
Brick
  • Object
show all
Defined in:
app/models/qbrick/placeholder_brick.rb

Constant Summary collapse

PARTIAL_PATH =
'/app/views/qbrick/placeholder_bricks/partials/_*.haml'

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Brick

#available_display_styles, #backend_label, #brick_list_type, #has_siblings?, #parents, #partial_digest, #set_position, #to_edit_childs_partial_path, #to_edit_partial_path, #to_style_class, #to_style_id, #translated_available_display_styles, #update_fulltext

Methods included from BrickList

#allowed_brick_types, #brick_types, #collect_fulltext, included, #renders_own_childs?, #to_brick_item_id, #to_brick_list_id, #uploader?, #user_can_delete?, #user_can_save?

Class Method Details

.available_partialsObject



7
8
9
# File 'app/models/qbrick/placeholder_brick.rb', line 7

def self.available_partials
  @partials ||= Qbrick::PartialExtractor.new.partials(PARTIAL_PATH)
end

Instance Method Details

#cache_keyObject



19
20
21
# File 'app/models/qbrick/placeholder_brick.rb', line 19

def cache_key
  super + partial_digest(partial_name)
end

#partial_nameObject



15
16
17
# File 'app/models/qbrick/placeholder_brick.rb', line 15

def partial_name
  "qbrick/placeholder_bricks/partials/#{template_name}"
end

#user_can_add_childs?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'app/models/qbrick/placeholder_brick.rb', line 11

def user_can_add_childs?
  false
end