rails_admin_import 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +13 -0
- data/lib/rails_admin_import/formats/file_importer.rb +3 -1
- data/lib/rails_admin_import/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 433bf6ef9b6b129fe87eaefcf77c073074c525ee
|
4
|
+
data.tar.gz: 6aa3d4adba6761d8dd66fa2546013402484a97fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 848291b1ee4367e81937750690f228500d3e3f54d3832b4fea4c9e3261b7f80fe3d6c6540eec54c5d422fcb577f1ca2ed225b980403409f336b31c5f6e3ab634
|
7
|
+
data.tar.gz: 6967a8a96dcd8a63496341bf958700e862b6e2076ec82fd213bd72813e97051d0a48e44ca4eccd0ed790b5196414790504d00108ca7f1b89621b9b84d94fd812
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -47,6 +47,7 @@ end
|
|
47
47
|
* If you are using CanCanCan for authorization, add to ability.rb to specify which models can be imported:
|
48
48
|
|
49
49
|
```ruby
|
50
|
+
cannot :import, :all
|
50
51
|
can :import, [User, Model1, Model2]
|
51
52
|
```
|
52
53
|
|
@@ -150,6 +151,18 @@ RailsAdmin.config do |config|
|
|
150
151
|
end
|
151
152
|
```
|
152
153
|
|
154
|
+
* To overwrite the [default excluded fields](https://github.com/stephskardal/rails_admin_import/blob/master/lib/rails_admin_import/config/sections/import.rb#L13) and allow matching to `:id` on import
|
155
|
+
|
156
|
+
```ruby
|
157
|
+
RailsAdmin.config do |config|
|
158
|
+
config.model 'User' do
|
159
|
+
import do
|
160
|
+
default_excluded_fields [:created_at, :updated_at]
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
```
|
165
|
+
|
153
166
|
## Import hooks
|
154
167
|
|
155
168
|
|
@@ -37,7 +37,9 @@ module RailsAdminImport
|
|
37
37
|
|
38
38
|
def copy_uploaded_file_to_log_dir
|
39
39
|
copy_filename = "#{Time.now.strftime("%Y-%m-%d-%H-%M-%S")}-import.csv"
|
40
|
-
|
40
|
+
dir_path = File.join(Rails.root, "log", "import")
|
41
|
+
FileUtils.mkdir_p(dir_path)
|
42
|
+
copy_path = File.join(dir_path, copy_filename)
|
41
43
|
FileUtils.copy(filename, copy_path)
|
42
44
|
end
|
43
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin_import
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steph Skardal
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -140,3 +140,4 @@ signing_key:
|
|
140
140
|
specification_version: 4
|
141
141
|
summary: Import functionality for Rails Admin
|
142
142
|
test_files: []
|
143
|
+
has_rdoc:
|