rails_importer 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -2
- data/README.md +10 -0
- data/app/controllers/rails_importer/imports_controller.rb +1 -1
- data/lib/rails_importer/controllers/helpers.rb +1 -1
- data/lib/rails_importer/setup.rb +6 -0
- data/lib/rails_importer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a076fef5b4f87f3cf1b9008206e1155b444d150
|
4
|
+
data.tar.gz: e6690a47e75330cfa4588996ccc02a203144eed8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f636dfdbec9ea7a0532e3b999b303ea3d40681ca5f04a39acee60c8bb90b112a081a70f32c92806494cb626ee56a27fb20acc277489544c5d0689e669c9cc281
|
7
|
+
data.tar.gz: 2664bcb16ebe6cf4e86b67b67f6f0deb4abb8afa6b1ab6727e4b58bf23706dff84c1a7ecac6cc181d82db022373b96fdea17b94af221396154e5497a7f83c563
|
data/CHANGELOG.md
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
functionality, or improves on an existing feature.
|
9
9
|
* `[UI]`: Non-breaking changes to the default user interface (HTML/CSS).
|
10
10
|
* `[BUGFIX]`: Fixes a bug with a non-breaking change.
|
11
|
-
* `[COMPAT]`: Compatibility improvements - changes to make
|
11
|
+
* `[COMPAT]`: Compatibility improvements - changes to make Rails Importer more
|
12
12
|
compatible with different dependency versions.
|
13
13
|
* `[I18n]`: Internationalization. Changes to translations or localizations.
|
14
14
|
* `[OPTIM]`: Optimization or performance increase.
|
@@ -16,9 +16,14 @@
|
|
16
16
|
|
17
17
|
## Changes
|
18
18
|
|
19
|
+
### 0.2.1 (August 30, 2016)
|
20
|
+
|
21
|
+
* [FEATURE] Add possibility to inherit `RailsImporter::ImportsController` from custom controller class
|
22
|
+
using gem initializer.
|
23
|
+
|
19
24
|
### 0.2.0 (February 18, 2016)
|
20
25
|
|
21
|
-
* [FEATURE] Add sample file link to import form which downloads a pre-defined sample file for each importer
|
26
|
+
* [FEATURE] Add sample file link to import form which downloads a pre-defined sample file for each importer.
|
22
27
|
|
23
28
|
### 0.1.0 (February 12, 2016)
|
24
29
|
|
data/README.md
CHANGED
@@ -100,6 +100,16 @@ The `importer_key` param is used to determine which importer class must be used.
|
|
100
100
|
|
101
101
|
Routes described above are handled by the `RailsImporter::ImportsController` controller. If you need custom logic, you can override it.
|
102
102
|
|
103
|
+
This controller inherits from standard `ApplicationController`. If you need to inherit from a particular controller (for example if you have a namespaced controller like `Admin::ApplicationController`), you can set this inside the initializer:
|
104
|
+
|
105
|
+
```ruby
|
106
|
+
# config/initializers/rails_importer.rb
|
107
|
+
|
108
|
+
RailsImporter.setup do |config|
|
109
|
+
config.parent_controller_class = Admin::ApplicationController
|
110
|
+
end
|
111
|
+
```
|
112
|
+
|
103
113
|
Besides that, the `after_import_path` controller method is used to redirect after successful imports. It defaults to `root_path`, but you can override it if you wish a custom path:
|
104
114
|
|
105
115
|
```ruby
|
data/lib/rails_importer/setup.rb
CHANGED
@@ -7,10 +7,16 @@ module RailsImporter
|
|
7
7
|
mattr_accessor :router_name
|
8
8
|
@@router_name = :main_app
|
9
9
|
|
10
|
+
mattr_accessor :parent_controller_class
|
11
|
+
|
10
12
|
def setup
|
11
13
|
yield self if block_given?
|
12
14
|
end
|
13
15
|
|
16
|
+
def parent_controller_class
|
17
|
+
@@parent_controller_class || ::ApplicationController
|
18
|
+
end
|
19
|
+
|
14
20
|
def importer_class(importer_key)
|
15
21
|
@@importers.select{|i| i.key.to_s == importer_key.to_s}.first
|
16
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_importer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastián Vicencio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|