activerecord-lookml 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27459b87408c0d5f3432f0b0242db4f630a10fce282dde64cc7d61fe12793fe7
4
- data.tar.gz: 6c23d271541d72ad3ef203d2e15b1b999a036cda1255bdd8fbfd90a69956d65e
3
+ metadata.gz: 51994f9cd3d936cd0d7df51d8ba8a9a0bf99aad22f03405fb9fc975d35263a11
4
+ data.tar.gz: 1e239e2f8f1474e2e340ac16df097dd6a78d6a500ab9614eae93990413e6fd80
5
5
  SHA512:
6
- metadata.gz: fbd0a06d11c2fd45c50118254ce498a6b7546f42fc99315bb3b4fa66fdd39d42aeff9f18c9ef1a2622125f598227081731ffd0ea18db78fd0ffb22e1a1af0ccb
7
- data.tar.gz: aa64159cbc81f1fa94c122515d2805ebabafb1ded067c44822969ac98f66ff8cce9cc9d35575557db00454427bb7b311a4116964341a793badc380c7b641b7cd
6
+ metadata.gz: dc3a73dfb0cbe15db67b7a025c6591bd3a92e6b98b671755e3ae4a09d396ddb45453f697d7edf7276ec8845c10c9d2e14f8b2f7c259cdeec4325c40d0701d2ef
7
+ data.tar.gz: 5c16904267407519928811f499c69f86dc62af8d0ecbc9415c874938a7787f9cfb46984be2ad8e47a479d69bee3b815d082af7bf13ad0962179d4a961a47fc43
data/CHANGELOG.md CHANGED
@@ -1,7 +1,15 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 0.2.1
4
+
5
+ Bug fixes and minor improvements.
6
+
7
+ ## 0.2.0
8
+
9
+ - Feature: LookML view generation from ActiveRecord class
10
+
3
11
  ## 0.1.0
4
12
 
5
13
  Initial version
6
14
 
7
- - Support LookML generation from ActiveRecord::Enum definitions
15
+ - Feature: LookML dimension generation from ActiveRecord::Enum definitions
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "activerecord/lookml"
4
+ require "active_record/lookml"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -7,8 +7,3 @@ module ActiveRecord
7
7
  # Your code goes here...
8
8
  end
9
9
  end
10
-
11
- ActiveSupport.on_load :active_record do
12
- require 'active_record/lookml/core'
13
- ::ActiveRecord::Base.send :include, ActiveRecord::LookML::Core
14
- end
@@ -130,7 +130,7 @@ view: pulse_onboarding_statuses {
130
130
  sql: ${TABLE}.#{attribute} ;;
131
131
  }
132
132
  LOOKML
133
- when ActiveRecord::Type::DateTime
133
+ when ActiveRecord::Type::DateTime, ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter
134
134
  <<-LOOKML
135
135
  dimension_group: #{attribute} {
136
136
  type: time
@@ -156,7 +156,7 @@ view: pulse_onboarding_statuses {
156
156
  }
157
157
  LOOKML
158
158
  else
159
- raise "Unknown attribute type: #{type.class}"
159
+ raise "Unknown attribute type: #{attribute} #{type.class}"
160
160
  end
161
161
  end
162
162
 
@@ -164,10 +164,10 @@ view: pulse_onboarding_statuses {
164
164
  case type
165
165
  when ActiveModel::Type::Integer, ActiveModel::Type::Boolean, ActiveRecord::Enum::EnumType
166
166
  attribute
167
- when ActiveRecord::Type::DateTime
167
+ when ActiveRecord::Type::DateTime, ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter
168
168
  "#{attribute}_time"
169
169
  else
170
- raise "Unknown attribute type: #{type.class}"
170
+ raise "Unknown attribute type: #{attribute} #{type.class}"
171
171
  end
172
172
  end
173
173
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module LookML
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -0,0 +1,7 @@
1
+ require 'active_support/all'
2
+ require "active_record/lookml"
3
+
4
+ ActiveSupport.on_load :active_record do
5
+ require 'active_record/lookml/core'
6
+ ActiveRecord::Base.include(ActiveRecord::LookML::Core)
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-lookml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshinori Kawasaki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-27 00:00:00.000000000 Z
11
+ date: 2021-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -88,6 +88,7 @@ files:
88
88
  - lib/active_record/lookml.rb
89
89
  - lib/active_record/lookml/core.rb
90
90
  - lib/active_record/lookml/version.rb
91
+ - lib/activerecord-lookml.rb
91
92
  homepage: https://github.com/wantedly/activerecord-lookml
92
93
  licenses:
93
94
  - MIT