Sha256: 5000f5a22fda6e9f8c9839ed468c242ef48ee2dbe90dfabc74e19fd89e5ece55

Contents?: true

Size: 240 Bytes

Versions: 7

Compression:

Stored size: 240 Bytes

Contents

module JupyterOnRails
  module Daru
    module DataFrameExt
      def write_model(model)
        require 'activerecord-import'

        objs = map_rows(&:to_h).map(&model.method(:new))
        model.import(objs)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
jupyter_on_rails-0.5.3 lib/jupyter_on_rails/daru/data_frame_ext.rb
jupyter_on_rails-0.5.2 lib/jupyter_on_rails/daru/data_frame_ext.rb
jupyter_on_rails-0.5.1 lib/jupyter_on_rails/daru/data_frame_ext.rb
jupyter_on_rails-0.5.0 lib/jupyter_on_rails/daru/data_frame_ext.rb
jupyter_on_rails-0.4.2 lib/jupyter_on_rails/daru/data_frame_ext.rb
jupyter_on_rails-0.4.1 lib/jupyter_on_rails/daru/data_frame_ext.rb
jupyter_on_rails-0.4.0 lib/jupyter_on_rails/daru/data_frame_ext.rb