lhs 7.4.0 → 7.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lhs.rb +15 -3
  3. data/lib/lhs/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4587fc1585c5d53dcbe9470a65cb49af38c965da
4
- data.tar.gz: 97345090e54f551ea4361c97f03b566c160c72ca
3
+ metadata.gz: 6716a12c5196762c84c68b946df362158e9c62f0
4
+ data.tar.gz: 594c16d1e84a6873c77560ae6ae229149c7e4813
5
5
  SHA512:
6
- metadata.gz: cb6d9e6fa5ee7585bb7af456ee60f521b322cc484dba2a4714896a1ffc1ef9ed40a1d1ed914446335dc487a486d042f596e9c08d30fad301b685dde75b51f254
7
- data.tar.gz: 7915323a720894ffd38e4810ae3f0bce107692f3db2df801b8d092918b7698d33b2ec4879788c15bcf0711371d1daadabae2893443714ea18e1d9011ad6a5300
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
- Dir.glob(app.root.join('app/models/**/*.rb')).each do |file|
12
- require file if File.read(file).match('LHS::Record')
13
- end
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
@@ -1,3 +1,3 @@
1
1
  module LHS
2
- VERSION = "7.4.0"
2
+ VERSION = "7.4.1"
3
3
  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: 7.4.0
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.5.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