app_rail-airtable 0.2.7 → 0.2.8

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: 59112ddcce193bb297ccdb3cebd972445183c4a9e755a1ccb7c91c695f600bb9
4
- data.tar.gz: ee3d1ff83a53b53f367aa7c84781113457a037abf4257a9d7ccf2589a167e456
3
+ metadata.gz: af89c3dbe402f9b53fc7c717de7c58d47fc8927e2388a21ca15d52464839a879
4
+ data.tar.gz: 74f42c9e64fe80c364d84c9b40ab7733a0d3bb597eb0f2b2d0c261673215cef8
5
5
  SHA512:
6
- metadata.gz: 5099f41bc41cc4a744e49586c2f727cca97cb1054131144094f1c3bbe3cbaac8acb020909acae4903d92920348a738f70ebac45f18a9150a1b3c6246b8e17807
7
- data.tar.gz: 4afb93f8f41cd9a306b1a5262fafcc30127f7c0df95c51e82b76fabf0a04b8e8e114381a432d44fb382e835021edbc5dcdc2727bee2bda12c6b23fdc5aad1b6e
6
+ metadata.gz: 859b5eb8d1de6589def9b76450087c13ab8a4b02d927a9210e69f620705c4ef096630e920a0deb201d194ba97feadb5437ec4e1d4f107fd0406aa132e37f8028
7
+ data.tar.gz: e4163e04b1e771930b6b338a28463a53b18678401f68285dda7342d66214f6f64b19c5be90f01ba891a01d51461100eacc7e3aa8918817b1710ba89815f9e844
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_rail-airtable (0.2.7)
4
+ app_rail-airtable (0.2.8)
5
5
  activesupport
6
6
  airrecord
7
7
  sinatra
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.create_from_params (create)
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.
@@ -43,7 +43,7 @@ module AppRail
43
43
  # Customisable behaviour
44
44
 
45
45
  # Override to provide custom sorting or filtering for index
46
- def self.index(current_user)
46
+ def self.index(user:)
47
47
  all
48
48
  end
49
49
 
@@ -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.create_with_params_as_json(params_and_json_body)
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
@@ -1,5 +1,5 @@
1
1
  module AppRail
2
2
  module Airtable
3
- VERSION = "0.2.7"
3
+ VERSION = "0.2.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_rail-airtable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brooke-Smith