Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

CSV Import #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Gem Sources
source 'https://rubygems.org'

Expand All @@ -25,11 +24,12 @@ gem 'inline_svg'
gem 'filterrific'
gem 'momentjs-rails', '>= 2.9.0'
gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47'
gem 'activeadmin', github: 'activeadmin'
gem 'activeadmin', '1.0.0'
gem "active_admin_import", github: "Fivell/active_admin_import"
gem 'active_bootstrap_skin'
gem 'meta-tags'
gem 'rack-cors', require: 'rack/cors'
gem 'whenever', require: false
gem 'rack-cors', require: 'rack/cors'
gem 'whenever', require: false

group :production do
gem 'sentry-raven'
Expand Down
91 changes: 53 additions & 38 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
GIT
remote: https://github.com/activeadmin/activeadmin.git
revision: 0df2df0bf65a6e22dcf46d01dbaa12d6e995fb89
remote: https://github.com/Fivell/active_admin_import.git
revision: b491d732217da040e828e369717b1b573cfa03eb
specs:
activeadmin (2.0.0.alpha)
arbre (>= 1.1.1)
formtastic (~> 3.1)
formtastic_i18n
inherited_resources (~> 1.7)
jquery-rails (>= 4.2.0)
kaminari (>= 1.0.1)
railties (>= 4.2, < 5.2)
ransack (~> 1.3)
sass (~> 3.4)
sprockets (>= 3.0, < 4.1)
sprockets-es6 (>= 0.9.2)
active_admin_import (3.0.0)
activeadmin (~> 1.0)
activerecord-import (~> 0.17.0)
rchardet (~> 1.6)
rubyzip (~> 1.2)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -43,6 +36,20 @@ GEM
rails-html-sanitizer (~> 1.0, >= 1.0.3)
active_bootstrap_skin (0.1.4)
bootstrap-sass (~> 3.3.6)
activeadmin (1.0.0)
arbre (>= 1.1.1)
bourbon
coffee-rails
formtastic (~> 3.1)
formtastic_i18n
inherited_resources (~> 1.7)
jquery-rails
jquery-ui-rails
kaminari (>= 0.15, < 2.0)
railties (>= 4.2, < 5.2)
ransack (~> 1.3)
sass-rails
sprockets (< 4.1)
activejob (5.1.3)
activesupport (= 5.1.3)
globalid (>= 0.3.6)
Expand All @@ -52,6 +59,8 @@ GEM
activemodel (= 5.1.3)
activesupport (= 5.1.3)
arel (~> 8.0)
activerecord-import (0.17.2)
activerecord (>= 3.2)
activerecord-session_store (1.1.0)
actionpack (>= 4.0, < 5.2)
activerecord (>= 4.0, < 5.2)
Expand All @@ -71,10 +80,6 @@ GEM
attr_required (1.0.1)
autoprefixer-rails (7.1.2.6)
execjs
babel-source (5.8.35)
babel-transpiler (0.7.0)
babel-source (>= 4.0, < 6)
execjs (~> 2.0)
better_errors (2.3.0)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
Expand All @@ -85,6 +90,9 @@ GEM
sass (>= 3.3.4)
bootstrap3-datetimepicker-rails (4.17.47)
momentjs-rails (>= 2.8.1)
bourbon (5.0.0)
sass (~> 3.4)
thor (~> 0.19)
builder (3.2.3)
byebug (9.0.6)
capybara (2.15.1)
Expand All @@ -98,6 +106,13 @@ GEM
ffi (~> 1.0, >= 1.0.11)
chronic (0.10.2)
coderay (1.1.1)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
erubi (1.6.1)
execjs (2.7.0)
Expand All @@ -122,10 +137,10 @@ GEM
hashie (3.5.6)
httpclient (2.8.3)
i18n (0.8.6)
inherited_resources (1.7.2)
actionpack (>= 3.2, < 5.2.x)
inherited_resources (1.8.0)
actionpack (>= 4.2, <= 5.2)
has_scope (~> 0.6)
railties (>= 3.2, < 5.2.x)
railties (>= 4.2, <= 5.2)
responders
inline_svg (1.2.3)
activesupport (>= 3.0)
Expand All @@ -137,19 +152,21 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (6.0.1)
railties (>= 3.2.16)
jwt (1.5.6)
kaminari (1.0.1)
kaminari (1.1.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.0.1)
kaminari-activerecord (= 1.0.1)
kaminari-core (= 1.0.1)
kaminari-actionview (1.0.1)
kaminari-actionview (= 1.1.1)
kaminari-activerecord (= 1.1.1)
kaminari-core (= 1.1.1)
kaminari-actionview (1.1.1)
actionview
kaminari-core (= 1.0.1)
kaminari-activerecord (1.0.1)
kaminari-core (= 1.1.1)
kaminari-activerecord (1.1.1)
activerecord
kaminari-core (= 1.0.1)
kaminari-core (1.0.1)
kaminari-core (= 1.1.1)
kaminari-core (1.1.1)
kgio (2.11.0)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand Down Expand Up @@ -191,7 +208,7 @@ GEM
omniauth-oauth2 (1.4.0)
oauth2 (~> 1.0)
omniauth (~> 1.2)
polyamorous (1.3.1)
polyamorous (1.3.3)
activerecord (>= 3.0)
public_suffix (2.0.5)
puma (3.10.0)
Expand Down Expand Up @@ -231,15 +248,16 @@ GEM
thor (>= 0.18.1, < 2.0)
raindrops (0.19.0)
rake (12.0.0)
ransack (1.8.3)
ransack (1.8.7)
actionpack (>= 3.0)
activerecord (>= 3.0)
activesupport (>= 3.0)
i18n
polyamorous (~> 1.3)
polyamorous (~> 1.3.2)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rchardet (1.7.0)
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
Expand Down Expand Up @@ -271,10 +289,6 @@ GEM
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-es6 (0.9.2)
babel-source (>= 5.8.11)
babel-transpiler
sprockets (>= 3.0.0)
sprockets-rails (3.2.0)
actionpack (>= 4.0)
activesupport (>= 4.0)
Expand Down Expand Up @@ -311,8 +325,9 @@ PLATFORMS
ruby

DEPENDENCIES
active_admin_import!
active_bootstrap_skin
activeadmin!
activeadmin (= 1.0.0)
activerecord-session_store
better_errors
bootstrap-sass
Expand Down
3 changes: 3 additions & 0 deletions app/admin/event.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ActiveAdmin.register Event do
permit_params Event.attribute_names.map(&:to_sym) # All attributes

active_admin_import validate: true


# Index Page
index do
selectable_column
Expand Down
2 changes: 1 addition & 1 deletion app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Event < ApplicationRecord
})

def dates_present?
return unless start_date.nil? || end_date.nil? || event_date.nil?
return unless start_date.nil? || end_date.nil?
errors.add(title, 'must have dates and times.') if event_date.nil? && start_date.nil? && end_date.nil?
if event_date.nil?
errors.add(title, 'must have start time.') if start_date.nil?
Expand Down