eav_hashes 1.0.3 → 1.1.0
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 +5 -5
- data/README.md +3 -1
- data/lib/eav_hashes/activerecord_extension.rb +1 -1
- data/lib/eav_hashes/version.rb +1 -1
- data/spec/dummy/config/application.rb +4 -2
- data/spec/dummy/config/environments/development.rb +3 -3
- data/spec/dummy/db/migrate/20121206133059_create_products.rb +1 -1
- data/spec/dummy/db/migrate/20121210055854_create_product_tech_specs.rb +1 -2
- data/spec/spec_helper.rb +13 -11
- metadata +26 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cb9d38f1f08d274333b230b7d79da331499008c012d8b503f876c97c82923d57
|
4
|
+
data.tar.gz: 1a0744a3d6c5f2ef16e6c2c5824a2ec29cb62018a8ed2210cf563e82e69189db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41a6abbf340fd8e7e697078c9352c9fbcd86548724109c1a33f72336a6fd8a6cff6557aebd3343efb429f89279375a736fef5bfe079b07e9166ae2f829c8ef86
|
7
|
+
data.tar.gz: 74e1f9f5f61f74ce3f95f630d2bbc4fffab872b31027235c5bab42d690ed93aa41d0a8c94a150d008d63ff1c01ab4772f80d16823055bde32171be9c88263c88
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Great question! Lets dive in with a simple code example, but first lets set up t
|
|
22
22
|
|
23
23
|
Put this in your gemfile...
|
24
24
|
|
25
|
-
gem "eav_hashes", "~> 1.0
|
25
|
+
gem "eav_hashes", "~> 1.1.0"
|
26
26
|
|
27
27
|
...and update your bundle.
|
28
28
|
|
@@ -143,6 +143,8 @@ Thanks to [Matt Kimmel](https://github.com/mattkimmel) for adding support for mo
|
|
143
143
|
|
144
144
|
Thanks to [Arpad Lukacs](https://github.com/arpadlukacs) for adding Enumerator-like behavior.
|
145
145
|
|
146
|
+
Thanks to [Christopher Bartling](https://github.com/cebartling) and [jenskdsgn] (https://github.com/jenskdsgn) for fixing deprecation warnings in Rails 5.
|
147
|
+
|
146
148
|
I found a bug or want to contribute!
|
147
149
|
-
|
148
150
|
You're probably reading this from GitHub, so you know what to do. If not, the
|
@@ -17,7 +17,7 @@ module ActiveRecord
|
|
17
17
|
|
18
18
|
# Create the association, the entry update hook, and a helper method to lazy-load the entries
|
19
19
|
class_eval <<-END_EVAL
|
20
|
-
has_many :#{options[:entry_assoc_name]}, class_name: #{options[:entry_class_name]}, foreign_key: "#{options[:parent_assoc_name]}_id", dependent: :delete_all
|
20
|
+
has_many :#{options[:entry_assoc_name]}, class_name: "#{options[:entry_class_name]}", foreign_key: "#{options[:parent_assoc_name]}_id", dependent: :delete_all
|
21
21
|
after_save :save_#{hash_name}
|
22
22
|
def #{hash_name}
|
23
23
|
@#{hash_name} ||= ActiveRecord::EavHashes::EavHash.new(self, @@#{hash_name}_hash_options)
|
data/lib/eav_hashes/version.rb
CHANGED
@@ -44,16 +44,18 @@ module Dummy
|
|
44
44
|
# Enable escaping HTML in JSON.
|
45
45
|
config.active_support.escape_html_entities_in_json = true
|
46
46
|
|
47
|
+
config.active_record.sqlite3.represent_boolean_as_integer = true
|
48
|
+
|
47
49
|
# Use SQL instead of Active Record's schema dumper when creating the database.
|
48
50
|
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
49
51
|
# like if you have constraints or database-specific column types
|
50
52
|
# config.active_record.schema_format = :sql
|
51
53
|
|
52
54
|
# Enable the asset pipeline
|
53
|
-
config.assets.enabled = true
|
55
|
+
# config.assets.enabled = true
|
54
56
|
|
55
57
|
# Version of your assets, change this if you want to expire all your assets
|
56
|
-
config.assets.version = '1.0'
|
58
|
+
# config.assets.version = '1.0'
|
57
59
|
|
58
60
|
# Cause Windows is a little bitch and can't handle a little ANSI escape sequence here and there
|
59
61
|
config.colorize_logging = false
|
@@ -21,13 +21,13 @@ Dummy::Application.configure do
|
|
21
21
|
|
22
22
|
# Log the query plan for queries taking more than this (works
|
23
23
|
# with SQLite, MySQL, and PostgreSQL)
|
24
|
-
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
24
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
25
25
|
|
26
26
|
# Do not compress assets
|
27
|
-
config.assets.compress = false
|
27
|
+
# config.assets.compress = false
|
28
28
|
|
29
29
|
# Expands the lines which load the assets
|
30
|
-
config.assets.debug = true
|
30
|
+
# config.assets.debug = true
|
31
31
|
|
32
32
|
# Introduced in Rails 4
|
33
33
|
config.eager_load = false
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class CreateProductTechSpecs < ActiveRecord::Migration
|
1
|
+
class CreateProductTechSpecs < ActiveRecord::Migration[5.0]
|
2
2
|
def change
|
3
3
|
create_table :product_tech_specs do |t|
|
4
4
|
t.references :product, :null => false
|
@@ -10,7 +10,6 @@ class CreateProductTechSpecs < ActiveRecord::Migration
|
|
10
10
|
t.timestamps
|
11
11
|
end
|
12
12
|
|
13
|
-
add_index :product_tech_specs, :product_id
|
14
13
|
add_index :product_tech_specs, :entry_key
|
15
14
|
end
|
16
15
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,3 @@
|
|
1
|
-
# destroy our test DB before rails gets to open it
|
2
|
-
begin
|
3
|
-
File.delete File.expand_path("../dummy/db/test.sqlite3", __FILE__)
|
4
|
-
rescue
|
5
|
-
puts "Unable to delete test.sqlite3!\nDon't worry if this is the first time running specs."
|
6
|
-
end
|
7
|
-
|
8
1
|
ENV["RAILS_ENV"] = "test"
|
9
2
|
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
10
3
|
|
@@ -12,9 +5,18 @@ require 'rspec/rails'
|
|
12
5
|
|
13
6
|
Rails.backtrace_cleaner.remove_silencers!
|
14
7
|
|
15
|
-
|
16
|
-
|
17
|
-
require
|
8
|
+
|
9
|
+
# Setup DB
|
10
|
+
require 'rake'
|
11
|
+
Dummy::Application.load_tasks
|
12
|
+
|
13
|
+
Rake::Task['db:drop'].invoke
|
14
|
+
Rake::Task['db:create'].invoke
|
15
|
+
Rake::Task['db:migrate'].invoke
|
16
|
+
Rake::Task['db:seed'].invoke
|
17
|
+
|
18
|
+
|
19
|
+
# require File.expand_path("../dummy/db/seeds.rb", __FILE__)
|
18
20
|
|
19
21
|
RSpec.configure do |config|
|
20
22
|
require 'rspec/expectations'
|
@@ -22,4 +24,4 @@ RSpec.configure do |config|
|
|
22
24
|
#config.formatter = :documentation
|
23
25
|
config.use_transactional_fixtures = true
|
24
26
|
config.include RSpec::Matchers
|
25
|
-
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eav_hashes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Ostrovskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -100,7 +100,8 @@ files:
|
|
100
100
|
- spec/lib/generators/eav_migration_spec.rb
|
101
101
|
- spec/spec_helper.rb
|
102
102
|
homepage: https://github.com/200proof/eav_hashes
|
103
|
-
licenses:
|
103
|
+
licenses:
|
104
|
+
- MIT
|
104
105
|
metadata: {}
|
105
106
|
post_install_message:
|
106
107
|
rdoc_options: []
|
@@ -118,44 +119,44 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
119
|
version: '0'
|
119
120
|
requirements: []
|
120
121
|
rubyforge_project:
|
121
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.7.3
|
122
123
|
signing_key:
|
123
124
|
specification_version: 4
|
124
125
|
summary: A developer-friendly implementation of the EAV model for Ruby on Rails.
|
125
126
|
test_files:
|
126
|
-
- spec/
|
127
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
128
|
-
- spec/dummy/app/controllers/application_controller.rb
|
129
|
-
- spec/dummy/app/helpers/application_helper.rb
|
127
|
+
- spec/spec_helper.rb
|
130
128
|
- spec/dummy/app/models/custom_test_object.rb
|
131
129
|
- spec/dummy/app/models/product.rb
|
130
|
+
- spec/dummy/app/controllers/application_controller.rb
|
132
131
|
- spec/dummy/app/views/layouts/application.html.erb
|
133
|
-
- spec/dummy/
|
134
|
-
- spec/dummy/
|
135
|
-
- spec/dummy/
|
136
|
-
- spec/dummy/config/
|
137
|
-
- spec/dummy/config/
|
132
|
+
- spec/dummy/app/assets/javascripts/application.js
|
133
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
134
|
+
- spec/dummy/app/helpers/application_helper.rb
|
135
|
+
- spec/dummy/config/routes.rb
|
136
|
+
- spec/dummy/config/locales/en.yml
|
138
137
|
- spec/dummy/config/environments/production.rb
|
138
|
+
- spec/dummy/config/environments/development.rb
|
139
139
|
- spec/dummy/config/environments/test.rb
|
140
|
+
- spec/dummy/config/environment.rb
|
141
|
+
- spec/dummy/config/application.rb
|
142
|
+
- spec/dummy/config/database.yml
|
143
|
+
- spec/dummy/config/boot.rb
|
140
144
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
141
|
-
- spec/dummy/config/initializers/inflections.rb
|
142
145
|
- spec/dummy/config/initializers/mime_types.rb
|
143
|
-
- spec/dummy/config/initializers/secret_token.rb
|
144
146
|
- spec/dummy/config/initializers/session_store.rb
|
145
147
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
146
|
-
- spec/dummy/config/
|
147
|
-
- spec/dummy/config/
|
148
|
+
- spec/dummy/config/initializers/secret_token.rb
|
149
|
+
- spec/dummy/config/initializers/inflections.rb
|
148
150
|
- spec/dummy/config.ru
|
149
|
-
- spec/dummy/
|
150
|
-
- spec/dummy/
|
151
|
-
- spec/dummy/
|
152
|
-
- spec/dummy/public/404.html
|
151
|
+
- spec/dummy/script/rails
|
152
|
+
- spec/dummy/Rakefile
|
153
|
+
- spec/dummy/public/favicon.ico
|
153
154
|
- spec/dummy/public/422.html
|
154
155
|
- spec/dummy/public/500.html
|
155
|
-
- spec/dummy/public/
|
156
|
-
- spec/dummy/
|
156
|
+
- spec/dummy/public/404.html
|
157
|
+
- spec/dummy/db/seeds.rb
|
158
|
+
- spec/dummy/db/migrate/20121206133059_create_products.rb
|
159
|
+
- spec/dummy/db/migrate/20121210055854_create_product_tech_specs.rb
|
157
160
|
- spec/dummy/README.rdoc
|
158
|
-
- spec/dummy/script/rails
|
159
161
|
- spec/lib/eav_hashes/eav_hash_spec.rb
|
160
162
|
- spec/lib/generators/eav_migration_spec.rb
|
161
|
-
- spec/spec_helper.rb
|