easy_ml 0.2.0.pre.rc21 → 0.2.0.pre.rc23

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: f0de4170b55d8d6e28cc09ac68421cbee2f0c441e6fb89e86207620fef642ee3
4
- data.tar.gz: 86e5b583cc202827bc3d2d9ea89fd4dd13f1d95f729ad5ae8d43936a66fe1a2f
3
+ metadata.gz: 685c66332f22f73eae21f3a3f7b41e4b20bbf80a62d399c3e48bfbd3308b2eba
4
+ data.tar.gz: f3c41802ceb906d5f050097c72608aea21d1c6a8cc37a501ba3fdafb00be9dae
5
5
  SHA512:
6
- metadata.gz: 1d066503c36f9daee59ad93a89b6f35ff6c211602181030036edc31b7ece52276fd252a7a85b549263a180f4ec85f86a04e498440f217b6431d8da0225d9de0e
7
- data.tar.gz: c9c69540e6fbbedd688517226cffc757938933317952f9318189200a259dbc5b0963de6dfaa330741ea50387d290980176837f78ea80de04ea5e76b8d8f1c794
6
+ metadata.gz: 0f69d5c2e1dfcfa7f3ffebe7587122107905f3f14dcf78abb1f2ed751c08064c83cf53bf04f11abe4de41d724f1746ec0912051b7c31eb232a1b976f4d5051ce
7
+ data.tar.gz: 97ea5c0b4e6fe51843953bbcc56fef71f4ee436db8bad7c340158109193cb212f9a4689008dc195f626f1fa1047d2f3b29a24c3513be2af7ae17ab0b2222b777
@@ -44,7 +44,8 @@ module EasyML
44
44
  end
45
45
 
46
46
  def easy_ml_root
47
- Rails.application.routes.routes.find { |r| r.app.app == EasyML::Engine }&.path&.spec&.to_s
47
+ path = Rails.application.routes.routes.find { |r| r.app.app == EasyML::Engine }&.path&.spec&.to_s
48
+ URI.join("#{request.scheme}://#{request.host_with_port}", path).to_s
48
49
  end
49
50
 
50
51
  inertia_share do
@@ -69,12 +69,15 @@ module EasyML
69
69
  datasource = Datasource.find(params[:id])
70
70
  datasource.update(is_syncing: true)
71
71
 
72
+ Rails.logger.info("X-Forwarded-Host: #{request.headers["X-Forwarded-Host"]}")
73
+ Rails.logger.info("X-Forwarded-Port: #{request.headers["X-Forwarded-Port"]}")
74
+
72
75
  # Start sync in background to avoid blocking
73
76
  datasource.refresh_async
74
77
 
75
- redirect_to easy_ml_datasources_path(host: request.host), notice: "Datasource is syncing..."
78
+ redirect_to easy_ml_datasources_path, notice: "Datasource is syncing..."
76
79
  rescue ActiveRecord::RecordNotFound
77
- redirect_to easy_ml_datasources_path(host: request.host), error: "Datasource not found..."
80
+ redirect_to easy_ml_datasources_path, error: "Datasource not found..."
78
81
  end
79
82
 
80
83
  private
@@ -93,12 +93,22 @@ module EasyML
93
93
  end
94
94
 
95
95
  def set_root_dir
96
- write_attribute(:root_dir, root_dir)
96
+ bump_version
97
+ write_attribute(:root_dir, default_root_dir)
98
+ end
99
+
100
+ def default_root_dir
101
+ File.join("datasets", underscored_name, version).to_s
97
102
  end
98
103
 
99
104
  def root_dir
100
- bump_version
101
- EasyML::Engine.root_dir.join("datasets").join(underscored_name).join(version).to_s
105
+ persisted = read_attribute(:root_dir)
106
+
107
+ if persisted.present? && !persisted.blank?
108
+ EasyML::Engine.root_dir.join(persisted).to_s
109
+ else
110
+ default_root_dir
111
+ end
102
112
  end
103
113
 
104
114
  def destructively_cleanup!
@@ -89,9 +89,12 @@ module EasyML
89
89
 
90
90
  def root_dir
91
91
  persisted = read_attribute(:root_dir)
92
- return persisted if persisted.present? && !persisted.to_s.blank?
93
92
 
94
- default_root_dir
93
+ if persisted.present? && !persisted.blank?
94
+ EasyML::Engine.root_dir.join(persisted).to_s
95
+ else
96
+ default_root_dir
97
+ end
95
98
  end
96
99
 
97
100
  def refresh_async
@@ -156,7 +159,7 @@ module EasyML
156
159
 
157
160
  def default_root_dir
158
161
  folder = name.gsub(/\s{2,}/, " ").split(" ").join("_").downcase
159
- EasyML::Engine.root_dir.join("datasources").join(folder)
162
+ File.join("datasources", folder)
160
163
  end
161
164
 
162
165
  def set_root_dir
@@ -484,11 +484,21 @@ module EasyML
484
484
  end
485
485
 
486
486
  def set_root_dir
487
- write_attribute(:root_dir, root_dir)
487
+ write_attribute(:root_dir, default_root_dir)
488
488
  end
489
489
 
490
490
  def root_dir
491
- EasyML::Engine.root_dir.join("models").join(underscored_name).to_s
491
+ persisted = read_attribute(:root_dir)
492
+
493
+ if persisted.present? && !persisted.blank?
494
+ EasyML::Engine.root_dir.join(persisted).to_s
495
+ else
496
+ default_root_dir
497
+ end
498
+ end
499
+
500
+ def default_root_dir
501
+ File.join("models", underscored_name).to_s
492
502
  end
493
503
 
494
504
  def load_model(force: false)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyML
4
- VERSION = "0.2.0-rc21"
4
+ VERSION = "0.2.0-rc23"
5
5
 
6
6
  module Version
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_ml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.pre.rc21
4
+ version: 0.2.0.pre.rc23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Shollenberger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-08 00:00:00.000000000 Z
11
+ date: 2025-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord