linked_rails 0.0.4.pre.g3e8f5731a → 0.0.4.pre.g4c8e21c9f

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: 76bfec9b29631dc8cd719c82274bddb1d60ef3c5e1f8bf7cecdf5083399a0b60
4
- data.tar.gz: 02a6fc22c0f6e5d208ad069d8e6d0aad21ad7b3f7c1a037d3b96173178a03861
3
+ metadata.gz: 884c4d2a050396b2d42ce0ab609c0cc98253329d021a895220f7f66da1a1a9e5
4
+ data.tar.gz: ee5e7b3c5ea648d0d8be65575ca112e7a5a890b93252ce0ed6898020b20b08f7
5
5
  SHA512:
6
- metadata.gz: d542dd3f7417f97d421359f29cfdee8a7e85e8f2f2214181ff704b2fa1bf019fb89d45d4f451c7a6291dd218b4ae78b74274c76e31bcb84c6ccfa830d304a59b
7
- data.tar.gz: 25a745a273273cd82e449e899cb29c930bc2fbc1f7a4f65e4ef6f3ec9e1b3afe7f8cb0ce86f2b524fe3627dd5f36bdfaca484818e81a319703560f537955d6fb
6
+ metadata.gz: ac37f6b43c7704819395842e21449b467bdcdc223d6956ec12b6fc4b1099f870838eba9a9694686c41d5018a3899b97dbc55c67c960e9d939bc9ddb012e91a3c
7
+ data.tar.gz: d5d54b001950759f40b89f44dc46a34787c6c80a8c7138f0dd7c6c53d317119ddd214e0906a2564993340b048d190786954f40499adaf430b6b435193a39f4a9
@@ -98,8 +98,6 @@ module LinkedRails
98
98
  params = param.permit(:include, :iri)
99
99
  params[:iri] = URI(params[:iri])
100
100
  params
101
- rescue URI::InvalidURIError
102
- params.except(:iri)
103
101
  end
104
102
 
105
103
  def resource_response_body(iri, rack_body, status)
@@ -251,7 +249,7 @@ module LinkedRails
251
249
 
252
250
  def sanitized_relative_path(iri) # rubocop:disable Metrics/AbcSize
253
251
  iri.path = "#{iri.path}/" unless iri.path&.ends_with?('/')
254
- uri = URI(LinkedRails.iri.path.chomp('/').present? ? iri.to_s.split("#{LinkedRails.iri.path}/").last : iri)
252
+ uri = URI(LinkedRails.iri.path.present? ? iri.to_s.split("#{LinkedRails.iri.path}/").last : iri)
255
253
 
256
254
  [uri.path, uri.query].compact.join('?')
257
255
  end
@@ -187,7 +187,7 @@ module LinkedRails
187
187
 
188
188
  def target_url_fallback # rubocop:disable Metrics/AbcSize
189
189
  base = (resource.try(:singular_resource?) ? resource.singular_iri : resource.iri).dup
190
- base.path = "#{base.path.chomp('/')}/#{target_path}" if target_path.present?
190
+ base.path = "#{base.path}/#{target_path}" if target_path.present?
191
191
  base.query = Rack::Utils.parse_nested_query(base.query).merge(target_query).to_param if target_query.present?
192
192
  base
193
193
  end
@@ -8,9 +8,8 @@ module LinkedRails
8
8
  include LinkedRails::Model
9
9
 
10
10
  attr_accessor :collection, :filter
11
- delegate :apply_scope, :association_base, :association_class, :child_resource, :default_page_size, :display,
12
- :include_members,:parent, :policy, :total_page_count, :unfiltered_collection, :user_context,
13
- to: :collection
11
+ delegate :apply_scope, :association_base, :association_class, :default_page_size, :display, :include_members,
12
+ :parent, :policy, :total_page_count, :unfiltered_collection, :user_context, to: :collection
14
13
  delegate :count, to: :members
15
14
 
16
15
  alias id iri
@@ -41,7 +41,7 @@ module LinkedRails
41
41
  def blob_preview_iri
42
42
  return unless ActiveStorage::Blob.service.present?
43
43
 
44
- "#{LinkedRails.iri(path: 'rails/active_storage/blobs/redirect')}/{signed_id}/preview"
44
+ "#{LinkedRails.iri(path: 'rails/active_storage/blobs/redirect')}/{signed_id}/preview')"
45
45
  end
46
46
 
47
47
  def blob_upload_iri
@@ -58,10 +58,7 @@ module LinkedRails
58
58
  end
59
59
 
60
60
  def new_resource_from_parent
61
- if requested_resource.is_a?(LinkedRails.collection_class) ||
62
- requested_resource.is_a?(LinkedRails.collection_view_class)
63
- return requested_resource.child_resource
64
- end
61
+ return requested_resource.child_resource if requested_resource.is_a?(Collection)
65
62
 
66
63
  parent_resource.build_child(
67
64
  controller_class,
@@ -38,7 +38,7 @@ module LinkedRails
38
38
  params = Rails.application.routes.recognize_path(iri.to_s, method: method)
39
39
 
40
40
  route_params_to_opts(params.merge(query), iri.to_s)
41
- rescue ActionController::RoutingError, SystemStackError
41
+ rescue ActionController::RoutingError
42
42
  EMPTY_IRI_OPTS.dup
43
43
  end
44
44
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linked_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4.pre.g3e8f5731a
4
+ version: 0.0.4.pre.g4c8e21c9f
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arthur Dingemans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-17 00:00:00.000000000 Z
11
+ date: 2022-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_response