app_rail-airtable 0.2.7 → 0.2.8
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/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/app_rail/airtable/application_record.rb +1 -1
- data/lib/app_rail/airtable/sinatra.rb +2 -2
- data/lib/app_rail/airtable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af89c3dbe402f9b53fc7c717de7c58d47fc8927e2388a21ca15d52464839a879
|
|
4
|
+
data.tar.gz: 74f42c9e64fe80c364d84c9b40ab7733a0d3bb597eb0f2b2d0c261673215cef8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 859b5eb8d1de6589def9b76450087c13ab8a4b02d927a9210e69f620705c4ef096630e920a0deb201d194ba97feadb5437ec4e1d4f107fd0406aa132e37f8028
|
|
7
|
+
data.tar.gz: e4163e04b1e771930b6b338a28463a53b18678401f68285dda7342d66214f6f64b19c5be90f01ba891a01d51461100eacc7e3aa8918817b1710ba89815f9e844
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -31,7 +31,7 @@ You should create a model class for each table you want to use in your App. Mode
|
|
|
31
31
|
To provide support for routes, models can implement
|
|
32
32
|
* ar_list_item (index)
|
|
33
33
|
* ar_stack (show)
|
|
34
|
-
* self.
|
|
34
|
+
* self.create_as_json (create)
|
|
35
35
|
|
|
36
36
|
### Servers
|
|
37
37
|
You should create a single server which extends `AppRail::Airtable::Sinatra`, then add routes with the `resources` macro to add `index`, `show` and `create` routes. You can also provide your own routes.
|
|
@@ -47,7 +47,7 @@ module AppRail
|
|
|
47
47
|
def self.index_route(name, authenticated)
|
|
48
48
|
get "/#{name.to_s}" do
|
|
49
49
|
authenticate! if authenticated
|
|
50
|
-
name.classify_constantize.index(authenticated ? current_user : nil).map(&:ar_list_item_as_json).to_json
|
|
50
|
+
name.classify_constantize.index(user: authenticated ? current_user : nil).map(&:ar_list_item_as_json).to_json
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|
|
@@ -61,7 +61,7 @@ module AppRail
|
|
|
61
61
|
def self.create_route(name, authenticated)
|
|
62
62
|
post "/#{name.to_s}" do
|
|
63
63
|
authenticate! if authenticated
|
|
64
|
-
as_json = name.classify_constantize.
|
|
64
|
+
as_json = name.classify_constantize.create_as_json(current_user: authenticated ? current_user : nil, params: params_and_json_body)
|
|
65
65
|
[201, as_json.to_json]
|
|
66
66
|
end
|
|
67
67
|
end
|