eav_hashes 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -20
- data/README.md +147 -147
- data/Rakefile +30 -30
- data/lib/eav_hashes/activerecord_extension.rb +37 -37
- data/lib/eav_hashes/eav_entry.rb +128 -128
- data/lib/eav_hashes/eav_hash.rb +167 -167
- data/lib/eav_hashes/util.rb +122 -122
- data/lib/eav_hashes/version.rb +5 -5
- data/lib/eav_hashes.rb +8 -8
- data/lib/generators/eav_migration/USAGE +26 -26
- data/lib/generators/eav_migration/eav_migration.rb +35 -35
- data/lib/generators/eav_migration/templates/eav_migration.erb +15 -15
- data/spec/dummy/README.rdoc +261 -261
- data/spec/dummy/Rakefile +7 -7
- data/spec/dummy/app/assets/javascripts/application.js +15 -15
- data/spec/dummy/app/assets/stylesheets/application.css +13 -13
- data/spec/dummy/app/controllers/application_controller.rb +3 -3
- data/spec/dummy/app/helpers/application_helper.rb +2 -2
- data/spec/dummy/app/models/custom_test_object.rb +6 -6
- data/spec/dummy/app/models/product.rb +3 -4
- data/spec/dummy/app/views/layouts/application.html.erb +14 -14
- data/spec/dummy/config/application.rb +62 -68
- data/spec/dummy/config/boot.rb +9 -9
- data/spec/dummy/config/database.yml +25 -25
- data/spec/dummy/config/environment.rb +5 -5
- data/spec/dummy/config/environments/development.rb +34 -37
- data/spec/dummy/config/environments/production.rb +70 -67
- data/spec/dummy/config/environments/test.rb +34 -37
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -7
- data/spec/dummy/config/initializers/inflections.rb +15 -15
- data/spec/dummy/config/initializers/mime_types.rb +5 -5
- data/spec/dummy/config/initializers/secret_token.rb +7 -7
- data/spec/dummy/config/initializers/session_store.rb +8 -8
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -14
- data/spec/dummy/config/locales/en.yml +5 -5
- data/spec/dummy/config/routes.rb +58 -58
- data/spec/dummy/config.ru +4 -4
- data/spec/dummy/db/migrate/20121206133059_create_products.rb +9 -9
- data/spec/dummy/db/migrate/20121210055854_create_product_tech_specs.rb +15 -15
- data/spec/dummy/db/seeds.rb +30 -30
- data/spec/dummy/public/404.html +26 -26
- data/spec/dummy/public/422.html +26 -26
- data/spec/dummy/public/500.html +25 -25
- data/spec/dummy/script/rails +6 -6
- data/spec/lib/eav_hashes/eav_hash_spec.rb +147 -137
- data/spec/lib/generators/eav_migration_spec.rb +60 -60
- data/spec/spec_helper.rb +24 -24
- metadata +25 -44
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +0 -35
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/ENV=test.log +0 -1
- data/spec/dummy/log/development.log +0 -46
- data/spec/dummy/log/test.log +0 -4623
@@ -1,138 +1,148 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "EavHash/EavEntry" do
|
4
|
-
# p[1-3] are defined in spec/dummy/db/seeds.rb and are used as fixtures
|
5
|
-
let (:p1) { Product.find_by_name("Product 1") }
|
6
|
-
let (:p2) { Product.find_by_name("Product 2") }
|
7
|
-
let (:p3) { Product.find_by_name("Product 3") }
|
8
|
-
|
9
|
-
it "deletes an EAV row when its value is set to nil" do
|
10
|
-
p3_id = p3.id
|
11
|
-
p3.tech_specs[:delete_me] = nil
|
12
|
-
p3.save!
|
13
|
-
|
14
|
-
p3_pulled = Product.find_by_id(p3_id)
|
15
|
-
p3_pulled.tech_specs.keys.length.should == 0
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
it "
|
35
|
-
p1.tech_specs["
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
p1.tech_specs["A
|
44
|
-
end
|
45
|
-
|
46
|
-
it "preserves Symbol value types" do
|
47
|
-
p1.tech_specs["A
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
it "preserves
|
81
|
-
p1.tech_specs["A
|
82
|
-
end
|
83
|
-
|
84
|
-
it "preserves
|
85
|
-
p1.tech_specs["
|
86
|
-
end
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
it "
|
127
|
-
|
128
|
-
end
|
129
|
-
|
130
|
-
it "
|
131
|
-
|
132
|
-
end
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "EavHash/EavEntry" do
|
4
|
+
# p[1-3] are defined in spec/dummy/db/seeds.rb and are used as fixtures
|
5
|
+
let (:p1) { Product.find_by_name("Product 1") }
|
6
|
+
let (:p2) { Product.find_by_name("Product 2") }
|
7
|
+
let (:p3) { Product.find_by_name("Product 3") }
|
8
|
+
|
9
|
+
it "deletes an EAV row when its value is set to nil" do
|
10
|
+
p3_id = p3.id
|
11
|
+
p3.tech_specs[:delete_me] = nil
|
12
|
+
p3.save!
|
13
|
+
|
14
|
+
p3_pulled = Product.find_by_id(p3_id)
|
15
|
+
# p3_pulled.tech_specs.keys.length.should == 0
|
16
|
+
expect(p3_pulled.tech_specs.keys.length).to eq(0)
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
it "is able to search for all models whose hashes contain a specified key" do
|
21
|
+
# Product.find_by_tech_specs("A String").length.should be == 2
|
22
|
+
expect(Product.find_by_tech_specs("A String").length).to eq(2)
|
23
|
+
|
24
|
+
# Product.find_by_tech_specs(:only_in_product_2).length.should be == 1
|
25
|
+
expect(Product.find_by_tech_specs(:only_in_product_2).length).to eq(1)
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "distinguishes between string and symbol keys" do
|
29
|
+
it "finds a value for symbol key \":symbolic_key\" in Product 1" do
|
30
|
+
# p1.tech_specs[:symbolic_key].should_not be_nil
|
31
|
+
expect(p1.tech_specs[:symbolic_key]).not_to be_nil
|
32
|
+
end
|
33
|
+
|
34
|
+
it "does not find a value for non-symbol key \"symbolic_key\" in Product 1" do
|
35
|
+
# p1.tech_specs["symbolic_key"].should be_nil
|
36
|
+
expect(p1.tech_specs["symbolic_key"]).to be_nil
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "preserves types between serialization and deserialization" do
|
41
|
+
it "preserves String value types" do
|
42
|
+
# p1.tech_specs["A String"].should be_a_kind_of String
|
43
|
+
expect(p1.tech_specs["A String"]).to be_a_kind_of String
|
44
|
+
end
|
45
|
+
|
46
|
+
it "preserves Symbol value types" do
|
47
|
+
# p1.tech_specs["A Symbol"].should be_a_kind_of Symbol
|
48
|
+
expect(p1.tech_specs["A Symbol"]).to be_a_kind_of Symbol
|
49
|
+
end
|
50
|
+
|
51
|
+
it "preserves Integer/Bignum/Fixnum value types" do
|
52
|
+
# p1.tech_specs["A Number"].should be_a_kind_of Integer
|
53
|
+
expect(p1.tech_specs["A Number"]).to be_a_kind_of Integer
|
54
|
+
end
|
55
|
+
|
56
|
+
it "preserves Symbol value types" do
|
57
|
+
expect(p1.tech_specs["A Float"]).to be_a_kind_of Float
|
58
|
+
end
|
59
|
+
|
60
|
+
it "preserves Complex value types" do
|
61
|
+
expect(p1.tech_specs["A Complex"]).to be_a_kind_of Complex
|
62
|
+
end
|
63
|
+
|
64
|
+
it "preserves Rational value types" do
|
65
|
+
expect(p1.tech_specs["A Rational"]).to be_a_kind_of Rational
|
66
|
+
end
|
67
|
+
|
68
|
+
it "preserves Boolean(true) value types" do
|
69
|
+
expect(p1.tech_specs["True"]).to be_a_kind_of TrueClass
|
70
|
+
end
|
71
|
+
|
72
|
+
it "preserves Boolean(false) value types" do
|
73
|
+
expect(p1.tech_specs["False"]).to be_a_kind_of FalseClass
|
74
|
+
end
|
75
|
+
|
76
|
+
it "preserves Array value types" do
|
77
|
+
expect(p1.tech_specs["An Array"]).to be_a_kind_of Array
|
78
|
+
end
|
79
|
+
|
80
|
+
it "preserves Hash value types" do
|
81
|
+
expect(p1.tech_specs["A Hash"]).to be_a_kind_of Hash
|
82
|
+
end
|
83
|
+
|
84
|
+
it "preserves user-defined value types" do
|
85
|
+
expect(p1.tech_specs["An Object"]).to be_a_kind_of CustomTestObject
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
describe "preserves values between serialization and deserialization" do
|
90
|
+
it "preserves String values" do
|
91
|
+
expect(p1.tech_specs["A String"]).to eq("Strings are for cats!")
|
92
|
+
end
|
93
|
+
|
94
|
+
it "preserves Symbols" do
|
95
|
+
expect(p1.tech_specs["A Symbol"]).to eq(:symbol)
|
96
|
+
end
|
97
|
+
|
98
|
+
it "preserves Integer/Bignum/Fixnum value types" do
|
99
|
+
expect(p1.tech_specs["A Number"]).to eq(42)
|
100
|
+
end
|
101
|
+
|
102
|
+
it "preserves Symbol values" do
|
103
|
+
expect(p1.tech_specs["A Float"]).to eq(3.141592653589793)
|
104
|
+
end
|
105
|
+
|
106
|
+
it "preserves Complex values" do
|
107
|
+
expect(p1.tech_specs["A Complex"]).to eq(Complex("3.141592653589793+42i"))
|
108
|
+
end
|
109
|
+
|
110
|
+
it "preserves Rational values" do
|
111
|
+
expect(p1.tech_specs["A Rational"]).to eq(Rational(Math::PI))
|
112
|
+
end
|
113
|
+
|
114
|
+
it "preserves Boolean(true) values" do
|
115
|
+
expect(p1.tech_specs["True"]).to eq(true)
|
116
|
+
end
|
117
|
+
|
118
|
+
it "preserves Boolean(false) values" do
|
119
|
+
expect(p1.tech_specs["False"]).to eq(false)
|
120
|
+
end
|
121
|
+
|
122
|
+
it "preserves Array values" do
|
123
|
+
expect(p1.tech_specs["An Array"]).to eq(["blue", 42, :flux_capacitor])
|
124
|
+
end
|
125
|
+
|
126
|
+
it "preserves Hash values" do
|
127
|
+
expect(p1.tech_specs["A Hash"]).to eq({:foo => :bar})
|
128
|
+
end
|
129
|
+
|
130
|
+
it "preserves user-defined values" do
|
131
|
+
expect(p1.tech_specs["An Object"].test_value).to eq(42)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
describe "cannot search by arrays, hashes, and objects" do
|
136
|
+
it "raises an error when searched by an object" do
|
137
|
+
expect(lambda { Product.find_by_tech_specs("An Object", CustomTestObject.new(42)) }).to raise_error()
|
138
|
+
end
|
139
|
+
|
140
|
+
it "raises an error when searched by a hash" do
|
141
|
+
expect(lambda { Product.find_by_tech_specs("A Hash", {:foo => :bar}) }).to raise_error()
|
142
|
+
end
|
143
|
+
|
144
|
+
it "raises an error when searched by an array" do
|
145
|
+
expect(lambda { Product.find_by_tech_specs("An Array", ["blue", 42, :flux_capacitor]) }).to raise_error()
|
146
|
+
end
|
147
|
+
end
|
138
148
|
end
|
@@ -1,61 +1,61 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe EavMigrationGenerator do
|
4
|
-
let(:top_level_model_generator) { EavMigrationGenerator.new(['TestModel', 'test_hash']) }
|
5
|
-
let(:one_module_generator) { EavMigrationGenerator.new(['Foo::TestModel', 'test_hash']) }
|
6
|
-
let(:multi_module_generator) { EavMigrationGenerator.new(['Foo::Bar::TestModel', 'test_hash']) }
|
7
|
-
|
8
|
-
describe "#model_association_name" do
|
9
|
-
context "when the model is at the top level" do
|
10
|
-
it "should underscore the model name" do
|
11
|
-
top_level_model_generator.model_association_name.
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
context "when the model is namespaced by one module" do
|
16
|
-
it "should underscore the model name, replacing the slash with an underscore" do
|
17
|
-
one_module_generator.model_association_name.
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
context "when the model is namespaced by multiple modules" do
|
22
|
-
it "should underscore the model name, replacing the slashes with underscores" do
|
23
|
-
multi_module_generator.model_association_name.
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "#table_name" do
|
29
|
-
context "when the model is at the top level" do
|
30
|
-
it "should underscore the model name and append the hash name" do
|
31
|
-
top_level_model_generator.table_name.
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
context "when the model is namespaced by one module" do
|
36
|
-
it "should underscore the model name, replacing the slash with an underscore, and append the hash name" do
|
37
|
-
one_module_generator.table_name.
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
context "when the model is namespaced by multiple modules" do
|
42
|
-
it "should underscore the model name, replacing the slashes with underscores, and append the hash name" do
|
43
|
-
multi_module_generator.table_name.
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe "#migration_file_name" do
|
49
|
-
context "when the model is at the top level" do
|
50
|
-
it "should return create_ followed by the table name" do
|
51
|
-
top_level_model_generator.migration_file_name.
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
context "when the model is namespaced by one or more modules" do
|
56
|
-
it "should return create_ followed by the table name, with module names included" do
|
57
|
-
multi_module_generator.migration_file_name.
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe EavMigrationGenerator do
|
4
|
+
let(:top_level_model_generator) { EavMigrationGenerator.new(['TestModel', 'test_hash']) }
|
5
|
+
let(:one_module_generator) { EavMigrationGenerator.new(['Foo::TestModel', 'test_hash']) }
|
6
|
+
let(:multi_module_generator) { EavMigrationGenerator.new(['Foo::Bar::TestModel', 'test_hash']) }
|
7
|
+
|
8
|
+
describe "#model_association_name" do
|
9
|
+
context "when the model is at the top level" do
|
10
|
+
it "should underscore the model name" do
|
11
|
+
expect(top_level_model_generator.model_association_name).to eq ("test_model")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context "when the model is namespaced by one module" do
|
16
|
+
it "should underscore the model name, replacing the slash with an underscore" do
|
17
|
+
expect(one_module_generator.model_association_name).to eq ("foo_test_model")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context "when the model is namespaced by multiple modules" do
|
22
|
+
it "should underscore the model name, replacing the slashes with underscores" do
|
23
|
+
expect(multi_module_generator.model_association_name).to eq ("foo_bar_test_model")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "#table_name" do
|
29
|
+
context "when the model is at the top level" do
|
30
|
+
it "should underscore the model name and append the hash name" do
|
31
|
+
expect(top_level_model_generator.table_name).to eq ("test_model_test_hash")
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context "when the model is namespaced by one module" do
|
36
|
+
it "should underscore the model name, replacing the slash with an underscore, and append the hash name" do
|
37
|
+
expect(one_module_generator.table_name).to eq ("foo_test_model_test_hash")
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context "when the model is namespaced by multiple modules" do
|
42
|
+
it "should underscore the model name, replacing the slashes with underscores, and append the hash name" do
|
43
|
+
expect(multi_module_generator.table_name).to eq ("foo_bar_test_model_test_hash")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe "#migration_file_name" do
|
49
|
+
context "when the model is at the top level" do
|
50
|
+
it "should return create_ followed by the table name" do
|
51
|
+
expect(top_level_model_generator.migration_file_name).to eq ("create_test_model_test_hash")
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
context "when the model is namespaced by one or more modules" do
|
56
|
+
it "should return create_ followed by the table name, with module names included" do
|
57
|
+
expect(multi_module_generator.migration_file_name).to eq ("create_foo_bar_test_model_test_hash")
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
61
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,25 +1,25 @@
|
|
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
|
-
ENV["RAILS_ENV"] = "test"
|
9
|
-
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
10
|
-
|
11
|
-
require 'rspec/rails'
|
12
|
-
|
13
|
-
Rails.backtrace_cleaner.remove_silencers!
|
14
|
-
|
15
|
-
# get some migrations up in here
|
16
|
-
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
|
17
|
-
require File.expand_path("../dummy/db/seeds.rb", __FILE__)
|
18
|
-
|
19
|
-
RSpec.configure do |config|
|
20
|
-
require 'rspec/expectations'
|
21
|
-
|
22
|
-
#config.formatter = :documentation
|
23
|
-
config.use_transactional_fixtures = true
|
24
|
-
config.include RSpec::Matchers
|
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
|
+
ENV["RAILS_ENV"] = "test"
|
9
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
10
|
+
|
11
|
+
require 'rspec/rails'
|
12
|
+
|
13
|
+
Rails.backtrace_cleaner.remove_silencers!
|
14
|
+
|
15
|
+
# get some migrations up in here
|
16
|
+
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
|
17
|
+
require File.expand_path("../dummy/db/seeds.rb", __FILE__)
|
18
|
+
|
19
|
+
RSpec.configure do |config|
|
20
|
+
require 'rspec/expectations'
|
21
|
+
|
22
|
+
#config.formatter = :documentation
|
23
|
+
config.use_transactional_fixtures = true
|
24
|
+
config.include RSpec::Matchers
|
25
25
|
end
|
metadata
CHANGED
@@ -1,74 +1,70 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eav_hashes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ilya Ostrovskiy
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 3.2.7
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 3.2.7
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: sqlite3
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
|
-
description:
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
heavy lifting is done for you.\n"
|
41
|
+
description: |2
|
42
|
+
eav_hashes allows you to to leverage the power of the EAV database model in the way you would expect to use it:
|
43
|
+
a hash. Unlike other gems which require you to create a special model and/or define which attributes you want to
|
44
|
+
have EAV behavior on (both of which defeat the purpose), all you need to do with eav_hashes is add one line to your
|
45
|
+
model and create a migration. All the heavy lifting is done for you.
|
52
46
|
email:
|
53
47
|
- ilya@200proof.cc
|
54
48
|
executables: []
|
55
49
|
extensions: []
|
56
50
|
extra_rdoc_files: []
|
57
51
|
files:
|
52
|
+
- MIT-LICENSE
|
53
|
+
- README.md
|
54
|
+
- Rakefile
|
55
|
+
- init.rb
|
56
|
+
- lib/eav_hashes.rb
|
58
57
|
- lib/eav_hashes/activerecord_extension.rb
|
59
58
|
- lib/eav_hashes/eav_entry.rb
|
60
59
|
- lib/eav_hashes/eav_hash.rb
|
61
60
|
- lib/eav_hashes/util.rb
|
62
61
|
- lib/eav_hashes/version.rb
|
63
|
-
- lib/
|
62
|
+
- lib/generators/eav_migration/USAGE
|
64
63
|
- lib/generators/eav_migration/eav_migration.rb
|
65
64
|
- lib/generators/eav_migration/templates/eav_migration.erb
|
66
|
-
- lib/generators/eav_migration/USAGE
|
67
65
|
- lib/tasks/eav_hashes_tasks.rake
|
68
|
-
-
|
69
|
-
-
|
70
|
-
- Rakefile
|
71
|
-
- README.md
|
66
|
+
- spec/dummy/README.rdoc
|
67
|
+
- spec/dummy/Rakefile
|
72
68
|
- spec/dummy/app/assets/javascripts/application.js
|
73
69
|
- spec/dummy/app/assets/stylesheets/application.css
|
74
70
|
- spec/dummy/app/controllers/application_controller.rb
|
@@ -76,6 +72,7 @@ files:
|
|
76
72
|
- spec/dummy/app/models/custom_test_object.rb
|
77
73
|
- spec/dummy/app/models/product.rb
|
78
74
|
- spec/dummy/app/views/layouts/application.html.erb
|
75
|
+
- spec/dummy/config.ru
|
79
76
|
- spec/dummy/config/application.rb
|
80
77
|
- spec/dummy/config/boot.rb
|
81
78
|
- spec/dummy/config/database.yml
|
@@ -91,49 +88,39 @@ files:
|
|
91
88
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
92
89
|
- spec/dummy/config/locales/en.yml
|
93
90
|
- spec/dummy/config/routes.rb
|
94
|
-
- spec/dummy/config.ru
|
95
|
-
- spec/dummy/db/development.sqlite3
|
96
91
|
- spec/dummy/db/migrate/20121206133059_create_products.rb
|
97
92
|
- spec/dummy/db/migrate/20121210055854_create_product_tech_specs.rb
|
98
|
-
- spec/dummy/db/schema.rb
|
99
93
|
- spec/dummy/db/seeds.rb
|
100
|
-
- spec/dummy/db/test.sqlite3
|
101
|
-
- spec/dummy/log/development.log
|
102
|
-
- spec/dummy/log/ENV=test.log
|
103
|
-
- spec/dummy/log/test.log
|
104
94
|
- spec/dummy/public/404.html
|
105
95
|
- spec/dummy/public/422.html
|
106
96
|
- spec/dummy/public/500.html
|
107
97
|
- spec/dummy/public/favicon.ico
|
108
|
-
- spec/dummy/Rakefile
|
109
|
-
- spec/dummy/README.rdoc
|
110
98
|
- spec/dummy/script/rails
|
111
99
|
- spec/lib/eav_hashes/eav_hash_spec.rb
|
112
100
|
- spec/lib/generators/eav_migration_spec.rb
|
113
101
|
- spec/spec_helper.rb
|
114
102
|
homepage: https://github.com/200proof/eav_hashes
|
115
103
|
licenses: []
|
104
|
+
metadata: {}
|
116
105
|
post_install_message:
|
117
106
|
rdoc_options: []
|
118
107
|
require_paths:
|
119
108
|
- lib
|
120
109
|
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
110
|
requirements:
|
123
|
-
- -
|
111
|
+
- - ">="
|
124
112
|
- !ruby/object:Gem::Version
|
125
113
|
version: '0'
|
126
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
|
-
none: false
|
128
115
|
requirements:
|
129
|
-
- -
|
116
|
+
- - ">="
|
130
117
|
- !ruby/object:Gem::Version
|
131
118
|
version: '0'
|
132
119
|
requirements: []
|
133
120
|
rubyforge_project:
|
134
|
-
rubygems_version:
|
121
|
+
rubygems_version: 2.5.1
|
135
122
|
signing_key:
|
136
|
-
specification_version:
|
123
|
+
specification_version: 4
|
137
124
|
summary: A developer-friendly implementation of the EAV model for Ruby on Rails.
|
138
125
|
test_files:
|
139
126
|
- spec/dummy/app/assets/javascripts/application.js
|
@@ -159,15 +146,9 @@ test_files:
|
|
159
146
|
- spec/dummy/config/locales/en.yml
|
160
147
|
- spec/dummy/config/routes.rb
|
161
148
|
- spec/dummy/config.ru
|
162
|
-
- spec/dummy/db/development.sqlite3
|
163
149
|
- spec/dummy/db/migrate/20121206133059_create_products.rb
|
164
150
|
- spec/dummy/db/migrate/20121210055854_create_product_tech_specs.rb
|
165
|
-
- spec/dummy/db/schema.rb
|
166
151
|
- spec/dummy/db/seeds.rb
|
167
|
-
- spec/dummy/db/test.sqlite3
|
168
|
-
- spec/dummy/log/development.log
|
169
|
-
- spec/dummy/log/ENV=test.log
|
170
|
-
- spec/dummy/log/test.log
|
171
152
|
- spec/dummy/public/404.html
|
172
153
|
- spec/dummy/public/422.html
|
173
154
|
- spec/dummy/public/500.html
|
Binary file
|