Method: Binda::FieldGroupsHelper#get_entries_number

Defined in:
app/helpers/binda/field_groups_helper.rb

#get_entries_numberObject

Retrieve the number of records present in the database for the current structure



29
30
31
32
33
34
35
36
# File 'app/helpers/binda/field_groups_helper.rb', line 29

def get_entries_number
  instance_type = @structure.instance_type
  if ['board', 'component'].include? instance_type
    "Binda::#{instance_type.classify}".constantize.where(structure_id:@structure.id).count 
  else
    0
  end
end