Skip to content

Commit b18f047

Browse files
authored
Merge pull request #428 from ForestAdmin/chore/merge-master-into-beta
2 parents 9fa0442 + 0901f25 commit b18f047

File tree

11 files changed

+211
-82
lines changed

11 files changed

+211
-82
lines changed

.github/workflows/build.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Build, Test and Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
name: Linting
12+
runs-on: ubuntu-latest
13+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
14+
steps:
15+
- name: Cancel previous running workflows
16+
uses: fkirc/skip-duplicate-actions@master
17+
- uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-node@v1
21+
- name: Get yarn cache directory path
22+
id: yarn-cache-dir-path
23+
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
24+
- uses: actions/cache@v2
25+
with:
26+
path: '**/node_modules'
27+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
28+
- name: install dependencies
29+
run: yarn
30+
- name: Lint commit message
31+
uses: wagoid/commitlint-github-action@v2
32+
33+
test:
34+
name: Tests
35+
runs-on: ubuntu-latest
36+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
37+
steps:
38+
- uses: actions/checkout@v2
39+
- uses: actions/setup-ruby@v1
40+
with:
41+
ruby-version: 2.7
42+
- name: Cache gem
43+
uses: actions/cache@v2
44+
with:
45+
path: vendor/bundle
46+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
47+
restore-keys: |
48+
${{ runner.os }}-gems-
49+
- name: Bundle install
50+
run: |
51+
bundle config path vendor/bundle
52+
gem install bundler -v '1.17.3'
53+
bundle install
54+
- name: Test
55+
env:
56+
RAILS_ENV: test
57+
run: |
58+
bundle exec rake test
59+
bundle exec rake db:migrate && bundle exec rspec --color --format doc
60+
- name: Send coverage
61+
uses: paambaati/[email protected]
62+
env:
63+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
64+
65+
66+
deploy:
67+
name: Release
68+
runs-on: ubuntu-latest
69+
needs: [lint, test]
70+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
71+
steps:
72+
- uses: actions/checkout@v2
73+
with:
74+
persist-credentials: false # GITHUB_TOKEN must not be set for the semantic release
75+
- uses: actions/setup-node@v1
76+
with:
77+
node-version: 12.13.0
78+
- uses: actions/cache@v2
79+
with:
80+
path: '**/node_modules'
81+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
82+
- name: Semantic Release
83+
uses: cycjimmy/semantic-release-action@v2
84+
id: semantic
85+
env:
86+
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
87+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
88+
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
89+
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
90+
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
91+
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
92+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

.releaserc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = {
1717
},
1818
],
1919
'@semantic-release/github',
20+
'semantic-release-rubygem',
2021
[
2122
'semantic-release-slack-bot',
2223
{

.travis.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [5.4.4](https://github.com/ForestAdmin/forest-rails/compare/v5.4.3...v5.4.4) (2021-02-19)
2+
3+
4+
### Bug Fixes
5+
6+
* display a warning on missing association ([#426](https://github.com/ForestAdmin/forest-rails/issues/426)) ([a4974a3](https://github.com/ForestAdmin/forest-rails/commit/a4974a33968eb3ec6574bf9fb0a0e59ca9b86b78))
7+
18
## [5.4.3](https://github.com/ForestAdmin/forest-rails/compare/v5.4.2...v5.4.3) (2021-01-28)
29

310

@@ -42,6 +49,13 @@
4249
* **role:** add support for new roles ACL permissions ([#391](https://github.com/ForestAdmin/forest-rails/issues/391)) ([ae3539e](https://github.com/ForestAdmin/forest-rails/commit/ae3539e59c49b525078639a6d316ae2b5598ed75))
4350
* handle hooks ([#382](https://github.com/ForestAdmin/forest-rails/issues/382)) ([8dd0e35](https://github.com/ForestAdmin/forest-rails/commit/8dd0e356be27b33379b2aaa0376deb3a76123300))
4451

52+
# [5.4.0](https://github.com/ForestAdmin/forest-rails/compare/v5.3.3...v5.4.0) (2020-12-10)
53+
54+
55+
### Features
56+
57+
* **role:** add support for new roles ACL permissions ([#391](https://github.com/ForestAdmin/forest-rails/issues/391)) ([ae3539e](https://github.com/ForestAdmin/forest-rails/commit/ae3539e59c49b525078639a6d316ae2b5598ed75))
58+
4559
# [6.0.0-beta.2](https://github.com/ForestAdmin/forest-rails/compare/v6.0.0-beta.1...v6.0.0-beta.2) (2020-12-09)
4660

4761

@@ -74,13 +88,6 @@
7488
* **auth:** New authentication system.
7589
The application_url must be set in the ForestLiana initializer, adding a regex CORS rule for null origin is required.
7690

77-
# [5.4.0](https://github.com/ForestAdmin/forest-rails/compare/v5.3.3...v5.4.0) (2020-12-10)
78-
79-
80-
### Features
81-
82-
* **role:** add support for new roles ACL permissions ([#391](https://github.com/ForestAdmin/forest-rails/issues/391)) ([ae3539e](https://github.com/ForestAdmin/forest-rails/commit/ae3539e59c49b525078639a6d316ae2b5598ed75))
83-
8491
## [5.3.3](https://github.com/ForestAdmin/forest-rails/compare/v5.3.2...v5.3.3) (2020-12-08)
8592

8693

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ end
1919
group :test do
2020
gem 'rake'
2121
gem 'sqlite3', '~> 1.4'
22-
gem 'simplecov', require: false
22+
gem 'simplecov', '~> 0.17.0', require: false
2323
end
2424

2525
gem 'rails', '6.0.3.4'

Gemfile.lock

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ GEM
8585
concurrent-ruby (1.1.7)
8686
crass (1.0.6)
8787
diff-lcs (1.4.4)
88-
docile (1.3.2)
88+
docile (1.3.5)
8989
erubi (1.10.0)
9090
globalid (0.4.2)
9191
activesupport (>= 4.2.0)
@@ -98,7 +98,7 @@ GEM
9898
i18n (1.8.5)
9999
concurrent-ruby (~> 1.0)
100100
ipaddress (0.8.3)
101-
json (2.3.1)
101+
json (2.5.1)
102102
json-jwt (1.12.0)
103103
activesupport (>= 4.2)
104104
aes_key_wrap
@@ -191,12 +191,11 @@ GEM
191191
rspec-mocks (~> 3.8.0)
192192
rspec-support (~> 3.8.0)
193193
rspec-support (3.8.3)
194-
simplecov (0.20.0)
194+
simplecov (0.17.1)
195195
docile (~> 1.1)
196-
simplecov-html (~> 0.11)
197-
simplecov_json_formatter (~> 0.1)
198-
simplecov-html (0.12.3)
199-
simplecov_json_formatter (0.1.2)
196+
json (>= 1.8, < 3)
197+
simplecov-html (~> 0.10.0)
198+
simplecov-html (0.10.2)
200199
sprockets (4.0.2)
201200
concurrent-ruby (~> 1.0)
202201
rack (> 1, < 3)
@@ -248,7 +247,7 @@ DEPENDENCIES
248247
rails (= 6.0.3.4)
249248
rake
250249
rspec-rails (= 3.8.2)
251-
simplecov
250+
simplecov (~> 0.17.0)
252251
sqlite3 (~> 1.4)
253252
useragent
254253

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
21
# Forest Admin in Rails
2+
33
[![Gem](https://badge.fury.io/rb/forest_liana.svg)](https://badge.fury.io/rb/forest_liana)
4-
[![CI status](https://travis-ci.org/ForestAdmin/forest-rails.svg?branch=master)](https://travis-ci.org/ForestAdmin/forest-rails)
4+
[![CI status](https://github.com/ForestAdmin/forest-rails/workflows/Build,%20Test%20and%20Deploy/badge.svg?branch=master)](https://github.com/ForestAdmin/forest-rails/actions)
55
[![Test Coverage](https://api.codeclimate.com/v1/badges/959c02b420b455eac51f/test_coverage)](https://codeclimate.com/github/ForestAdmin/forest-rails/test_coverage)
66
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
77

@@ -10,6 +10,7 @@ Forest Admin provides an off-the-shelf administration panel based on a highly-ex
1010
This project has been designed with scalability in mind to fit requirements from small projects to mature companies.
1111

1212
## Who Uses Forest Admin
13+
1314
- [Apartmentlist](https://www.apartmentlist.com)
1415
- [Carbon Health](https://carbonhealth.com)
1516
- [Ebanx](https://www.ebanx.com)
@@ -23,9 +24,11 @@ This project has been designed with scalability in mind to fit requirements from
2324
- And hundreds more…
2425

2526
## Getting Started
27+
2628
[https://docs.forestadmin.com/documentation/getting-started/installation](https://docs.forestadmin.com/documentation/getting-started/installation)
2729

2830
## Documentation
31+
2932
[https://docs.forestadmin.com/documentation/](https://docs.forestadmin.com/documentation/)
3033

3134
## How it works
@@ -35,6 +38,7 @@ This project has been designed with scalability in mind to fit requirements from
3538
</p>
3639

3740
Forest Admin consists of two components:
41+
3842
- The Admin Frontend is the user interface where you'll manage your data and configuration.
3943
- The Admin Backend API hosted on your servers where you can find and extend your data models and all the business logic (routes, actions, …) related to your admin panel.
4044

@@ -46,27 +50,31 @@ user and your application data through the Admin API.
4650
## Features
4751

4852
### CRUD
53+
4954
All of your CRUD operations are natively supported. The API automatically
5055
supports your data models' validation and allows you to easily extend or
5156
override any API routes' with your very own custom logic.
5257

5358
<img src="https://www.forestadmin.com/public/img/illustrations-dev/screens/ForestWebsite20-CRUD.jpg" alt="CRUD">
5459

5560
### Search & Filters
61+
5662
Forest Admin has a built-in search allowing you to run basic queries to
5763
retrieve your application's data. Set advanced filters based on fields and
5864
relationships to handle complex search use cases.
5965

6066
<img src="https://www.forestadmin.com/public/img/illustrations-dev/screens/ForestWebsite20-Search.jpg" alt="Search and Filters">
6167

6268
### Sorting & Pagination
69+
6370
Sorting and pagination features are natively handled by the Admin API. We're
6471
continuously optimizing how queries are run in order to display results faster
6572
and reduce the load of your servers.
6673

6774
<img src="https://www.forestadmin.com/public/img/illustrations-dev/screens/ForestWebsite20-Sorting.jpg" alt="Sorting and Pagination">
6875

6976
### Custom action
77+
7078
A custom action is a button which allows you to trigger an API call to execute
7179
a custom logic. With virtually no limitations, you can extend the way you
7280
manipulate data and trigger actions (e.g. refund a customer, apply a coupon,
@@ -75,42 +83,49 @@ ban a user, etc.)
7583
<img src="https://www.forestadmin.com/public/img/illustrations-dev/screens/ForestWebsite20-Custom.jpg" alt="Sorting and Pagination">
7684

7785
### Export
86+
7887
Sometimes you need to export your data to a good old fashioned CSV. Yes, we
7988
know this can come in handy sometimes :-)
8089

8190
<img src="https://www.forestadmin.com/public/img/illustrations-dev/screens/ForestWebsite20-Export.jpg" alt="Export">
8291

8392
### Segments
93+
8494
Get in app access to a subset of your application data by doing a basic search
8595
or typing an SQL query or implementing an API route.
8696

8797
<img src="https://www.forestadmin.com/public/img/illustrations-dev/screens/ForestWebsite20-Segments.jpg" alt="Segments">
8898

8999
### Dashboards
100+
90101
Forest Admin is able to tap into your actual data to chart out your metrics
91102
using a simple UI panel, a SQL query or a custom API call.
92103

93104
<img src="https://www.forestadmin.com/public/img/illustrations-dev/screens/ForestWebsite20-Dashboard.jpg" alt="Dashboard">
94105

95106
### WYSIWYG
107+
96108
The WYSIWYG interface saves you a tremendous amount of frontend development
97109
time using drag'n'drop as well as advanced widgets to build customizable views.
98110

99111
<img src="https://www.forestadmin.com/public/img/illustrations-dev/screens/ForestWebsite20-Wysiwyg.jpg" alt="WYSIWYG">
100112

101113
### Custom HTML/JS/CSS
114+
102115
Code your own views using JS, HTML, and CSS to display your application data in
103116
a more appropriate way (e.g. Kanban, Map, Calendar, Gallery, etc.).
104117

105118
<img src="https://www.forestadmin.com/public/img/illustrations-dev/screens/ForestWebsite20-CustomHTML.jpg" alt="Custom views">
106119

107120
### Team-based permissions
121+
108122
Without any lines of code, manage directly from the UI who has access or can
109123
act on which data using a team-based permission system.
110124

111125
<img src="https://www.forestadmin.com/public/img/illustrations-dev/screens/ForestWebsite20-Teams.jpg" alt="Team based permissions">
112126

113127
### Third-party integrations
128+
114129
Leverage data from third-party services by reconciling it with your
115130
application’s data and providing it directly to your Admin Panel. All your
116131
actions can be performed at the same place, bringing additional intelligence to
@@ -119,12 +134,14 @@ your Admin Panel and ensuring consistency.
119134
<img src="https://www.forestadmin.com/public/img/illustrations-dev/screens/ForestWebsite20-3rdParty.jpg" alt="Third-party integrations">
120135

121136
### Notes & Comments
137+
122138
Assign your teammates to specific tasks, leave a note or simply comment a
123139
record, thereby simplifying collaboration all across your organization.
124140

125141
<img src="https://www.forestadmin.com/public/img/illustrations-dev/screens/ForestWebsite20-Notes.jpg" alt="Notes and Comments">
126142

127143
### Activity logs
144+
128145
Monitor each action executed and follow the trail of modification on any data
129146
with an extensive activity log system.
130147

@@ -145,6 +162,7 @@ Here is the contribution workflow:
145162
5. Submit a **Pull request** so that we can review your changes
146163

147164
Please ensure that the **tests** are passing before submitting any pull request:
165+
148166
```
149167
$ RAILS_ENV=test bundle exec rake --trace db:migrate test
150168
```

app/services/forest_liana/schema_utils.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ module ForestLiana
22
class SchemaUtils
33

44
def self.associations(active_record_class)
5-
active_record_class
6-
.reflect_on_all_associations
7-
.select { |association| !polymorphic?(association) && !is_active_type?(association.klass) }
5+
active_record_class.reflect_on_all_associations.select do |association|
6+
begin
7+
!polymorphic?(association) && !is_active_type?(association.klass)
8+
rescue
9+
FOREST_LOGGER.warn "Unknown association #{association.name} on class #{active_record_class.name}"
10+
false
11+
end
12+
end
813
end
914

1015
def self.one_associations(active_record_class)

0 commit comments

Comments
 (0)