activeadmin_active_resource 0.2.6 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99217ffe9d6e57fd4eda0bd713c760eafb6bf3418765e12ad0b5a76d8bc002cd
4
- data.tar.gz: 2b41192fec46788df9075ec0d3cdff979f500b25d07e03158566b7b19a05e6f8
3
+ metadata.gz: 06d3aa76315211525ccd4d69007025cfba04b8deb63a8da4179a2ebc4fb83785
4
+ data.tar.gz: 6584c61b9802923a7943c4c154a02f9a885232080c37ae3759087d8d810b0652
5
5
  SHA512:
6
- metadata.gz: 47692d3c049165f2e7b92bc272d7c555fdc04a69230be34eb6455c1c8b04ab4bc733487332752ba961b1cdcf23dfb9b3308083ce94a3615916ab827415e726a7
7
- data.tar.gz: a1ea9e3409e76431f0a67f197ed54a7d7abbd1fdfd8978c3c4c89519f5fcdd9e47daff79e1b08d8dfa920b23200f8e7d3ca64264e62638c180e451ff815e8c9c
6
+ metadata.gz: b62d57e2aeccaaa682a543551974913d47a4dbef7854406bb7991985a2b208eabbcd572135c1f19c3e417b00e2d25b103c5d30af9ee691a39a69f1ee17d36242
7
+ data.tar.gz: 9b61cd5847ea23fa8c54cb39691e6c05090838a764492bd4daebcea4f79788b1c91facce8a401081bdff36bd5dcdd11b07ea033c4961d4040ab6deded791256e
data/README.md CHANGED
@@ -1,26 +1,38 @@
1
1
  # Active Admin + Active Resource
2
- [![Gem Version](https://badge.fury.io/rb/activeadmin_active_resource.svg)](https://badge.fury.io/rb/activeadmin_active_resource) [![CircleCI](https://circleci.com/gh/blocknotes/activeadmin_active_resource.svg?style=svg)](https://circleci.com/gh/blocknotes/activeadmin_active_resource)
2
+ [![gem version](https://badge.fury.io/rb/activeadmin_active_resource.svg)](https://badge.fury.io/rb/activeadmin_active_resource)
3
+ [![gem downloads](https://badgen.net/rubygems/dt/activeadmin_active_resource)](https://rubygems.org/gems/activeadmin_active_resource)
4
+ [![linters](https://github.com/blocknotes/activeadmin_active_resource/actions/workflows/linters.yml/badge.svg)](https://github.com/blocknotes/activeadmin_active_resource/actions/workflows/linters.yml)
5
+ [![specs](https://github.com/blocknotes/activeadmin_active_resource/actions/workflows/specs.yml/badge.svg)](https://github.com/blocknotes/activeadmin_active_resource/actions/workflows/specs.yml)
6
+ [![specs2](https://github.com/blocknotes/activeadmin_active_resource/actions/workflows/specs2.yml/badge.svg)](https://github.com/blocknotes/activeadmin_active_resource/actions/workflows/specs2.yml)
3
7
 
4
8
  An Active Admin plugin to use a REST API data source in place of a local database using [Active Resource](https://github.com/rails/activeresource).
5
9
 
6
10
  **NOTICE**: currently some Active Admin features don't work as expected:
11
+
7
12
  - Filters are partially supported (see example)
8
13
  - Some form fields must be configured explicitly (like the associations)
9
14
  - Comments are not supported
10
15
 
16
+ Please :star: if you like it.
17
+
11
18
  ## Install
19
+
12
20
  - Add to your project's Gemfile (with Active Admin installed): `gem 'activeadmin_active_resource'`
13
21
  - Execute bundle
14
22
  - Disable comments in Active Admin config initializer (`config.comments = false`)
15
23
 
16
24
  ## Examples
25
+
17
26
  Please take a look at the examples folder:
27
+
18
28
  - a Rails6 application with Active Admin and this component, see [here](examples/rails6-admin);
19
- - a Rails6 API application used as data source, see [here](examples/rails6-api).
29
+ - a Rails6 API application used as data source, see [here](examples/rails6-api);
30
+ - a Roda API application used as data source, see [here](examples/roda-api).
20
31
 
21
- For another example check the [specs](spec).
32
+ For more examples check the [specs](spec).
22
33
 
23
34
  Basic instructions:
35
+
24
36
  - Post model:
25
37
  ```rb
26
38
  class Post < ActiveResource::Base
@@ -40,6 +52,7 @@ class Post < ActiveResource::Base
40
52
  }
41
53
  end
42
54
  ```
55
+
43
56
  - Post admin config:
44
57
  ```rb
45
58
  ActiveAdmin.register Post do
@@ -61,6 +74,7 @@ ActiveAdmin.register Post do
61
74
  end
62
75
  end
63
76
  ```
77
+
64
78
  - Ransack options [here](https://github.com/activerecord-hackery/ransack#search-matchers)
65
79
  - Rails API index example with Ransack and Kaminari:
66
80
  ```rb
@@ -80,15 +94,19 @@ end
80
94
  ```
81
95
 
82
96
  ## Notes
97
+
83
98
  If you create a new rails project don't use *--skip-active-record*.
84
99
 
85
100
  ## Do you like it? Star it!
86
- If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
87
101
 
88
- Take a look at [other Active Admin components](https://github.com/blocknotes?utf8=✓&tab=repositories&q=activeadmin&type=source) if you are curious.
102
+ If you use this component just star it. A developer is more motivated to improve a project when there is some interest. My other [Active Admin components](https://github.com/blocknotes?utf8=✓&tab=repositories&q=activeadmin&type=source).
103
+
104
+ Or consider offering me a coffee, it's a small thing but it is greatly appreciated: [about me](https://www.blocknot.es/about-me).
89
105
 
90
106
  ## Contributors
107
+
91
108
  - [Mattia Roccoberton](http://blocknot.es): author
92
109
 
93
110
  ## License
111
+
94
112
  The gem is available as open-source under the terms of the [MIT](LICENSE.txt).
data/Rakefile CHANGED
@@ -1,3 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'bundler/gem_tasks'
4
+
5
+ begin
6
+ require 'rspec/core/rake_task'
7
+
8
+ RSpec::Core::RakeTask.new(:spec) do |t|
9
+ # t.ruby_opts = %w[-w]
10
+ t.rspec_opts = ['--color', '--format documentation']
11
+ end
12
+
13
+ task default: :spec
14
+ rescue LoadError
15
+ puts '! LoadError: no RSpec available'
16
+ end
@@ -50,14 +50,13 @@ module ActiveAdmin
50
50
  # ref: http://api.rubyonrails.org/classes/ActiveRecord/ModelSchema/ClassMethods.html#method-i-columns
51
51
  def columns
52
52
  # => array of ActiveRecord::ConnectionAdapters::Column
53
- @columns ||= begin
53
+ @columns ||=
54
54
  schema.map do |name, type|
55
55
  col_name = name.to_s
56
56
  col_type = type.to_sym
57
57
  col_type = :hidden if col_name == 'id'
58
58
  OpenStruct.new(name: col_name, type: col_type)
59
59
  end
60
- end
61
60
  end
62
61
 
63
62
  def find_all(options = {})
@@ -129,8 +128,8 @@ module ActiveAdmin
129
128
 
130
129
  class << base
131
130
  prepend ClassMethods
132
- end
133
- end
131
+ end
132
+ end
134
133
  end
135
134
  end
136
135
  end
@@ -1,8 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_admin'
4
+ require 'active_resource'
5
+
4
6
  require_relative 'base'
5
7
  require_relative 'connection'
8
+ require_relative 'results'
6
9
 
7
10
  module ActiveAdmin
8
11
  module ActiveResource
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveAdmin
4
4
  module ActiveResource
5
- VERSION = '0.2.6'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
@@ -1,4 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'activeadmin/active_resource/results'
4
3
  require 'activeadmin/active_resource/engine'
4
+
5
+ module ActiveAdmin
6
+ module ActiveResource; end
7
+ end
@@ -1,4 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_resource'
4
3
  require 'activeadmin/active_resource'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_active_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-15 00:00:00.000000000 Z
11
+ date: 2022-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin
@@ -28,170 +28,30 @@ dependencies:
28
28
  name: activeresource
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 5.1.1
33
+ version: '5.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: 5.1.1
41
- - !ruby/object:Gem::Dependency
42
- name: activestorage
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 6.0.3.2
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 6.0.3.2
55
- - !ruby/object:Gem::Dependency
56
- name: capybara
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 3.33.0
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 3.33.0
69
- - !ruby/object:Gem::Dependency
70
- name: pry
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 0.13.1
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 0.13.1
83
- - !ruby/object:Gem::Dependency
84
- name: puma
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 4.3.5
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 4.3.5
97
- - !ruby/object:Gem::Dependency
98
- name: rspec_junit_formatter
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 0.4.1
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
38
+ - - ">="
109
39
  - !ruby/object:Gem::Version
110
- version: 0.4.1
40
+ version: '5.1'
111
41
  - !ruby/object:Gem::Dependency
112
- name: rspec-rails
42
+ name: appraisal
113
43
  requirement: !ruby/object:Gem::Requirement
114
44
  requirements:
115
45
  - - "~>"
116
46
  - !ruby/object:Gem::Version
117
- version: 4.0.1
47
+ version: '2.4'
118
48
  type: :development
119
49
  prerelease: false
120
50
  version_requirements: !ruby/object:Gem::Requirement
121
51
  requirements:
122
52
  - - "~>"
123
53
  - !ruby/object:Gem::Version
124
- version: 4.0.1
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 0.90.0
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 0.90.0
139
- - !ruby/object:Gem::Dependency
140
- name: selenium-webdriver
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: 3.142.7
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: 3.142.7
153
- - !ruby/object:Gem::Dependency
154
- name: sqlite3
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: 1.4.2
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: 1.4.2
167
- - !ruby/object:Gem::Dependency
168
- name: vcr
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: 6.0.0
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: 6.0.0
181
- - !ruby/object:Gem::Dependency
182
- name: webmock
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: 3.9.2
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: 3.9.2
54
+ version: '2.4'
195
55
  description: An Active Admin plugin to use Active Resource
196
56
  email: mat@blocknot.es
197
57
  executables: []
@@ -211,7 +71,10 @@ files:
211
71
  homepage: https://github.com/blocknotes/activeadmin_active_resource
212
72
  licenses:
213
73
  - MIT
214
- metadata: {}
74
+ metadata:
75
+ homepage_uri: https://github.com/blocknotes/activeadmin_active_resource
76
+ source_code_uri: https://github.com/blocknotes/activeadmin_active_resource
77
+ rubygems_mfa_required: 'true'
215
78
  post_install_message:
216
79
  rdoc_options: []
217
80
  require_paths:
@@ -220,14 +83,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
220
83
  requirements:
221
84
  - - ">="
222
85
  - !ruby/object:Gem::Version
223
- version: '0'
86
+ version: 2.6.0
224
87
  required_rubygems_version: !ruby/object:Gem::Requirement
225
88
  requirements:
226
89
  - - ">="
227
90
  - !ruby/object:Gem::Version
228
91
  version: '0'
229
92
  requirements: []
230
- rubygems_version: 3.0.3
93
+ rubygems_version: 3.1.6
231
94
  signing_key:
232
95
  specification_version: 4
233
96
  summary: Active Resource for ActiveAdmin