class ActionBlocks::AttachmentBuilder
Public Instance Methods
before_build(parent, *args)
click to toggle source
Calls superclass method
ActionBlocks::FieldBlock#before_build
# File lib/action_blocks/builders/model_builder.rb, line 506 def before_build(parent, *args) super(parent, *args) @attachment_type = 'image' @field_type = 'attachment' end
hashify(user)
click to toggle source
# File lib/action_blocks/builders/model_builder.rb, line 526 def hashify(user) { type: :attachment, attachment_type: @attachment_type, id: @id, model_key: @parent_model.key } end
match_requirements(select_as_prefix = nil)
click to toggle source
# File lib/action_blocks/builders/model_builder.rb, line 519 def match_requirements(select_as_prefix = nil) raise "should not use attachment in match conditions" { path: [select_as_prefix, @id].compact } end
select_requirements(select_as_prefix = nil)
click to toggle source
# File lib/action_blocks/builders/model_builder.rb, line 512 def select_requirements(select_as_prefix = nil) { field_name: [select_as_prefix,@id].compact.join('_').to_sym, path: [:id] } end