Sha256: ccd57c1c1dc0a11df64241412577b07535c2f41f524e54f05028faa75c16efc1

Contents?: true

Size: 232 Bytes

Versions: 5

Compression:

Stored size: 232 Bytes

Contents

module AppFrame::SelectHelper
  def prepopulate(association)
    return [].to_json unless association
  
    association = [association] if association.is_a?(ActiveRecord::Base)
    association.map(&:to_token_hash).to_json
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
app_frame-0.6.1 app/helpers/app_frame/select_helper.rb
app_frame-0.5.8 app/helpers/app_frame/select_helper.rb
app_frame-0.5.7 app/helpers/app_frame/select_helper.rb
app_frame-0.5.6 app/helpers/app_frame/select_helper.rb
app_frame-0.5.5 app/helpers/app_frame/select_helper.rb