lhs 7.4.0 → 7.4.1
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/lib/lhs.rb +15 -3
- data/lib/lhs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6716a12c5196762c84c68b946df362158e9c62f0
|
4
|
+
data.tar.gz: 594c16d1e84a6873c77560ae6ae229149c7e4813
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ac1f9e2374f8aeddaeb1c22640183279e78665e5576650367ff6a1474e96113dd4c22e03899d34829b2ad3bbdbbc916189e153434734a94e52becb1c6f5bc35
|
7
|
+
data.tar.gz: 9b42e020507260c37d906112bfbc99945c077a9546857ef41858d55c86cc069fe0abec4ffb816957f9d78cdecef24edb13738ee3cdd35b26e25ce8af14b6b519
|
data/lib/lhs.rb
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
require 'lhc'
|
2
2
|
|
3
3
|
module LHS
|
4
|
+
class RequireLhsRecords
|
5
|
+
def initialize(app)
|
6
|
+
@app = app
|
7
|
+
end
|
8
|
+
|
9
|
+
def call(env)
|
10
|
+
Dir.glob(Rails.root.join('app/models/**/*.rb')).each do |file|
|
11
|
+
require_dependency file if File.read(file).match('LHS::Record')
|
12
|
+
end
|
13
|
+
@app.call(env)
|
14
|
+
end
|
15
|
+
end
|
4
16
|
end
|
5
17
|
|
6
18
|
Gem.find_files('lhs/**/*.rb').sort.each { |path| require path }
|
@@ -8,8 +20,8 @@ Gem.find_files('lhs/**/*.rb').sort.each { |path| require path }
|
|
8
20
|
# Preload all the LHS::Records that are defined in app/models
|
9
21
|
class Engine < Rails::Engine
|
10
22
|
initializer 'Load all LHS::Records from app/models/**' do |app|
|
11
|
-
|
12
|
-
|
13
|
-
|
23
|
+
next if app.config.cache_classes
|
24
|
+
|
25
|
+
app.config.middleware.use LHS::RequireLhsRecords
|
14
26
|
end
|
15
27
|
end
|
data/lib/lhs/version.rb
CHANGED
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: 7.4.
|
4
|
+
version: 7.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://github.com/local-ch/lhs/graphs/contributors
|
@@ -380,7 +380,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
380
380
|
requirements:
|
381
381
|
- Ruby >= 2.0.0
|
382
382
|
rubyforge_project:
|
383
|
-
rubygems_version: 2.
|
383
|
+
rubygems_version: 2.6.8
|
384
384
|
signing_key:
|
385
385
|
specification_version: 4
|
386
386
|
summary: Rails gem providing an easy, active-record-like interface for http json services
|