Sha256: 2d6974850abb0c4d43ccfb4a62979768aa364bd28ae55af12fc2dd4d3bbc1235

Contents?: true

Size: 379 Bytes

Versions: 5

Compression:

Stored size: 379 Bytes

Contents

module Adminos::ArrayAttrs
  extend ActiveSupport::Concern

  module ClassMethods
    def array_attrs(*args)
      options = args.extract_options!

      args.each do |name|
        define_method :"#{name}_to_a" do
          value = send(name)
          split = value.split("\n") || []
          values = split.map { |value| value.strip }
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
adminos-1.0.0.pre.rc.5 lib/adminos/helpers/models/array_attrs.rb
adminos-1.0.0.pre.rc.4 lib/adminos/helpers/models/array_attrs.rb
adminos-1.0.0.pre.rc.3 lib/adminos/helpers/models/array_attrs.rb
adminos-1.0.0.pre.rc.2 lib/adminos/helpers/models/array_attrs.rb
adminos-1.0.0.pre.rc.1 lib/adminos/helpers/models/array_attrs.rb