lhs 17.0.1.pre1 → 17.0.1

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: dc1ec3342e623997b9001eb4319134b6319e4aea4370ad9f749eb1a72a19ff5f
4
- data.tar.gz: eea0a9db769438362041234e8c139123eedf03cd8a70132c4c9bd6bcef618cee
3
+ metadata.gz: 26f630cf54aef6e5cea546ba548bd0887c29b0c3e65266970b70565749738a73
4
+ data.tar.gz: 71a4ac28abd38913e0e170cc928a0770fce1b82d680e271b09daa06520a73290
5
5
  SHA512:
6
- metadata.gz: e200f657de31a04ff70c926adecf2cf9cc671e0fcb5f4e56fe9845acf7bd768f5f12c37c3d9da54d8d3f669652c072889c79373351ec111bb87edc4b4146265d
7
- data.tar.gz: ac01c2aebd32e243ab7b42180609bec88ee8bbac7d1869ad7b5284e7e00bb88a03ebcfa833501526fb66e77df403b65d55cd91f3cc88a565579d4dc267627117
6
+ metadata.gz: f2c866f8435f31e03325f5062741ae469db4e7a2d72230725153a7526fbc1bfaa02110f795becb6689d1f228e17db91aed4173a119dbf605e26f09c713030e81
7
+ data.tar.gz: 3319744ddd423474740a28f695e76bdcf2cd46be27482b7f8c949f6c8ee9648f54157aec10e2d2ca7e52e47079f1853e1530c95583e0754d81f7f8759489c803
@@ -2,3 +2,4 @@ source 'https://rubygems.org/'
2
2
 
3
3
  gemspec
4
4
  gem 'activesupport', '~> 4.2.0'
5
+ gem 'bundler', '~> 1.17.3'
data/README.md CHANGED
@@ -48,8 +48,11 @@ record.review # "Lunch was great
48
48
  * [Ambiguous endpoints](#ambiguous-endpoints)
49
49
  * [Record inheritance](#record-inheritance)
50
50
  * [Find multiple records](#find-multiple-records)
51
+ * [fetch](#fetch)
51
52
  * [where](#where)
52
53
  * [Reuse/Dry where statements: Use scopes](#reusedry-where-statements-use-scopes)
54
+ * [all](#all)
55
+ * [all with unpaginated endpoints](#all-with-unpaginated-endpoints)
53
56
  * [Retrieve the amount of a collection of items: count vs. length](#retrieve-the-amount-of-a-collection-of-items-count-vs-length)
54
57
  * [Find single records](#find-single-records)
55
58
  * [find](#find)
@@ -65,6 +68,7 @@ record.review # "Lunch was great
65
68
  * [has_one](#has_one)
66
69
  * [Unwrap nested items from the response body](#unwrap-nested-items-from-the-response-body)
67
70
  * [Determine collections from the response body](#determine-collections-from-the-response-body)
71
+ * [Load additional data based on retrieved data](#load-additional-data-based-on-retrieved-data)
68
72
  * [Chain complex queries](#chain-complex-queries)
69
73
  * [Chain where queries](#chain-where-queries)
70
74
  * [Expand plain collections of links: expanded](#expand-plain-collections-of-links-expanded)
@@ -741,6 +745,33 @@ GET https://service.example.com/search?q=Starbucks
741
745
  {... docs: [... {... address: 'Bahnhofstrasse 5, 8000 Zürich' }] }
742
746
  ```
743
747
 
748
+ #### Load additional data based on retrieved data
749
+
750
+ In order to load linked data from already retrieved data, you can use `load!` (or `reload!`).
751
+
752
+ ```ruby
753
+ # app/controllers/some_controller.rb
754
+
755
+ record = Record.find(1)
756
+ record.associated_thing.load!
757
+ ```
758
+ ```
759
+ GET https://things/4
760
+ { name: "Steve" }
761
+ ```
762
+ ```ruby
763
+ # app/controllers/some_controller.rb
764
+ record.associated_thing.name # Steve
765
+
766
+ record.associated_thing.load! # Does NOT create another request, as it is already loaded
767
+ record.associated_thing.reload! # Does request the data again from remote
768
+
769
+ ```
770
+ ```
771
+ GET https://things/4
772
+ { name: "Steve" }
773
+ ```
774
+
744
775
  ### Chain complex queries
745
776
 
746
777
  > [Method chaining](https://en.wikipedia.org/wiki/Method_chaining), also known as named parameter idiom, is a common syntax for invoking multiple method calls in object-oriented programming languages. Each method returns an object, allowing the calls to be chained together without requiring variables to store the intermediate results
data/cider-ci/bin/bundle CHANGED
@@ -47,3 +47,5 @@ if [ ! -f $CACHE_SIGNATURE_FILE ] ; then
47
47
  touch $CACHE_SIGNATURE_FILE
48
48
  fi
49
49
 
50
+ echo "bundle install"
51
+ bundle install
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support'
4
+ require 'active_support/core_ext'
4
5
 
5
6
  class LHS::Record
6
7
 
data/lib/lhs/record.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support'
4
-
5
3
  class LHS::Record
6
4
  autoload :Batch,
7
5
  'lhs/concerns/record/batch'
data/lib/lhs/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LHS
4
- VERSION = '17.0.1.pre1'
4
+ VERSION = '17.0.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhs
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.0.1.pre1
4
+ version: 17.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/local-ch/lhs/graphs/contributors
@@ -464,9 +464,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
464
464
  version: 2.3.0
465
465
  required_rubygems_version: !ruby/object:Gem::Requirement
466
466
  requirements:
467
- - - ">"
467
+ - - ">="
468
468
  - !ruby/object:Gem::Version
469
- version: 1.3.1
469
+ version: '0'
470
470
  requirements:
471
471
  - Ruby >= 2.3.0
472
472
  rubyforge_project: