fmrest-core 0.23.1 → 0.24.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: e4204d06743939015713907f35c283ff99decd257a0aaee50593ed3a660b87d9
4
- data.tar.gz: ca4a4c30b8a06d0f3eb20601d9003328d2c63e651f9acf35c03838ba690fddfc
3
+ metadata.gz: c4163332d71db6386b5fc11f5d61d03f79900f14cf4527775d11e121383ea986
4
+ data.tar.gz: b9e925cdacc12f8702e55be3469c7d96e8923dc67653affceb7993930aa7e0f0
5
5
  SHA512:
6
- metadata.gz: 58817b269adc26fa4c74f180ac4b1b8de5578bb041979bf694fa2b977a96a2830368c21617b1e82722b266f8c6829772c94332afbc527680d3e6146ebec0786c
7
- data.tar.gz: 3306e169f3aad1b6c32291cc9541b354f8316baa7d08abbd3ac31fe453d8051abd0352a065a7d1b4fd9857b08f9d7bd106725ebfab5807492bad305ca437328c
6
+ metadata.gz: c5dcecdf947a5ba024ed3b58446eff83dd5f9bb6ef79a12ebf91d7f015a4d46ad8c80be82e12f1a47184e35f1afffa9e071f6ac352c664c1cc76d10a0b4aae5b
7
+ data.tar.gz: 118a714382f4c712556849bf235e87ccab0bc0d59ca6bd2b8469ac19c5b99498a426f7e74fb031d777504c6623d9cbe2e0dd0d0cfe46e448bd3204eaecbf6f3d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Changelog
2
2
 
3
+ ### 0.24.0
4
+
5
+ * Add `FmRest::Layout.ignore_mod_id` flag
6
+
3
7
  ### 0.23.1
4
8
 
5
9
  * Fix crash when booting in Rails and `config/fmrest.yml` didn't exist
data/README.md CHANGED
@@ -469,6 +469,36 @@ class method. Also note that this will only catch exceptions raised during an
469
469
  API call to the Data API server (in other words, only on actions that perform
470
470
  an HTTP request).
471
471
 
472
+ ### Optional `modId`
473
+
474
+ The Data API provides an optional `modId` value that gets set on a record every
475
+ time you fetch or update it. This value then gets included in the API request
476
+ when you save the record, and FileMaker compares it against the current value,
477
+ preventing the update in case of a mismatch.
478
+
479
+ This safety feature is enabled by default in `fmrest-spyke` models, but you can
480
+ disable it using the inheritable `ignore_mod_id` flag on your model classes or
481
+ instances. E.g.
482
+
483
+ ```ruby
484
+ class Bee < FmRest::Layout
485
+ # This disables modId for all instances and subclasses
486
+ self.ignore_mod_id = true
487
+ end
488
+
489
+ # Or set it on instances:
490
+ bee = Bee.new
491
+ bee.ignore_mod_id # => true (set in class)
492
+ bee.ignore_mod_id = false # (affects only this instance)
493
+ ```
494
+
495
+ You can also set it directly on `FmRest::Layout` if you want to disable it for
496
+ your entire app:
497
+
498
+ ```ruby
499
+ FmRest::Layout.ignore_mod_id = true
500
+ ```
501
+
472
502
  ## Logging
473
503
 
474
504
  If using `fmrest-spyke` with Rails then pretty log output will be set up for
@@ -10,15 +10,15 @@ module FmRest
10
10
  end
11
11
 
12
12
  def load(key)
13
- raise NotImplementedError
13
+ raise NoMethodError
14
14
  end
15
15
 
16
16
  def store(key, value)
17
- raise NotImplementedError
17
+ raise NoMethodError
18
18
  end
19
19
 
20
20
  def delete(key)
21
- raise NotImplementedError
21
+ raise NoMethodError
22
22
  end
23
23
  end
24
24
  end
@@ -1,7 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "fmrest/token_store/base"
4
- require "moneta"
4
+
5
+ begin
6
+ require "moneta"
7
+ rescue LoadError => e
8
+ e.message << " (Did you include moneta in your Gemfile?)" unless e.message.frozen?
9
+ raise e
10
+ end
5
11
 
6
12
  module FmRest
7
13
  module TokenStore
@@ -30,7 +30,7 @@ module FmRest
30
30
  end
31
31
 
32
32
  def token_store_option
33
- raise NotImplementedError
33
+ raise NoMethodError
34
34
  end
35
35
  end
36
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FmRest
4
- VERSION = "0.23.1"
4
+ VERSION = "0.24.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fmrest-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.1
4
+ version: 0.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Carbajal
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-14 00:00:00.000000000 Z
11
+ date: 2022-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday