trax_model 0.0.92 → 0.0.93
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/README.md +227 -86
- data/lib/trax.rb +0 -1
- data/lib/trax/model.rb +23 -29
- data/lib/trax/model/attributes.rb +3 -1
- data/lib/trax/model/attributes/attribute.rb +11 -0
- data/lib/trax/model/attributes/definitions.rb +16 -0
- data/lib/trax/model/attributes/errors.rb +8 -0
- data/lib/trax/model/attributes/fields.rb +74 -0
- data/lib/trax/model/attributes/mixin.rb +48 -19
- data/lib/trax/model/attributes/type.rb +4 -0
- data/lib/trax/model/attributes/types/array.rb +8 -25
- data/lib/trax/model/attributes/types/boolean.rb +51 -0
- data/lib/trax/model/attributes/types/enum.rb +53 -12
- data/lib/trax/model/attributes/types/json.rb +36 -33
- data/lib/trax/model/attributes/types/string.rb +50 -0
- data/lib/trax/model/attributes/types/uuid_array.rb +17 -28
- data/lib/trax/model/attributes/value.rb +16 -0
- data/lib/trax/model/errors.rb +7 -0
- data/lib/trax/model/mixins.rb +11 -0
- data/lib/trax/model/mixins/field_scopes.rb +60 -0
- data/lib/trax/model/mixins/id_scopes.rb +36 -0
- data/lib/trax/model/mixins/sort_by_scopes.rb +25 -0
- data/lib/trax/model/railtie.rb +1 -0
- data/lib/trax/model/scopes.rb +16 -0
- data/lib/trax/model/struct.rb +168 -14
- data/lib/trax/model/unique_id.rb +14 -21
- data/lib/trax/model/uuid.rb +1 -1
- data/lib/trax/validators/enum_attribute_validator.rb +9 -0
- data/lib/trax/validators/future_validator.rb +1 -1
- data/lib/trax/validators/json_attribute_validator.rb +3 -3
- data/lib/trax/validators/string_attribute_validator.rb +17 -0
- data/lib/trax_model/version.rb +1 -1
- data/spec/db/database.yml +16 -0
- data/spec/db/schema/default_tables.rb +68 -0
- data/spec/db/schema/pg_tables.rb +27 -0
- data/spec/spec_helper.rb +20 -3
- data/spec/support/models.rb +123 -0
- data/spec/support/pg/models.rb +103 -0
- data/spec/trax/model/attributes/fields_spec.rb +88 -0
- data/spec/trax/model/attributes/types/enum_spec.rb +51 -0
- data/spec/trax/model/attributes/types/json_spec.rb +107 -0
- data/spec/trax/model/attributes_spec.rb +13 -0
- data/spec/trax/model/errors_spec.rb +1 -2
- data/spec/trax/model/mixins/field_scopes_spec.rb +7 -0
- data/spec/trax/model/struct_spec.rb +1 -1
- data/spec/trax/model/unique_id_spec.rb +1 -3
- data/spec/trax/validators/url_validator_spec.rb +1 -1
- data/trax_model.gemspec +4 -4
- metadata +57 -19
- data/lib/trax/model/config.rb +0 -16
- data/lib/trax/model/validators.rb +0 -15
- data/lib/trax/validators/enum_validator.rb +0 -16
- data/spec/support/schema.rb +0 -151
- data/spec/trax/model/config_spec.rb +0 -13
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ::Trax::Model::Attributes::Fields do
|
4
|
+
subject{ ::Products::MensShoes.fields }
|
5
|
+
|
6
|
+
describe "#all" do
|
7
|
+
it { expect(subject.all).to have_key(:size) }
|
8
|
+
|
9
|
+
context "inherited properties" do
|
10
|
+
it { expect(subject.all).to have_key(:active) }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe "#by_type" do
|
15
|
+
it { expect(subject.by_type(:boolean)).to have_key(:active) }
|
16
|
+
|
17
|
+
context "enums" do
|
18
|
+
[:size, :status].each do |k|
|
19
|
+
it "has #{k}" do
|
20
|
+
expect(subject.by_type(:enum)).to have_key(k)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "#to_schema" do
|
27
|
+
it { expect(subject.to_schema).to be_a(Hash) }
|
28
|
+
|
29
|
+
context "enums" do
|
30
|
+
it {
|
31
|
+
expect(subject.to_schema["status"]["source"]).to eq "Products::MensShoes::Fields::Status"
|
32
|
+
}
|
33
|
+
|
34
|
+
context "includes full choice definitions" do
|
35
|
+
let(:expectation) do
|
36
|
+
{
|
37
|
+
"source"=>"Products::MensShoes::Fields::Status::InStock",
|
38
|
+
"name"=>"in_stock",
|
39
|
+
"type"=>:enum_value,
|
40
|
+
"integer_value"=>1
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
it { expect(subject.to_schema["status"]["choices"][0]).to eq expectation }
|
45
|
+
end
|
46
|
+
|
47
|
+
context "values" do
|
48
|
+
let(:expectation) do
|
49
|
+
::Products::MensShoes::Fields::Size.names.map(&:to_sym)
|
50
|
+
end
|
51
|
+
|
52
|
+
it { expect(subject.to_schema["size"]["values"]).to eq expectation }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
context "booleans" do
|
57
|
+
it { expect(subject.to_schema["active"]["name"]).to eq "active" }
|
58
|
+
it { expect(subject.to_schema["active"]["type"]).to eq "boolean" }
|
59
|
+
it { expect(subject.to_schema["active"]["source"]).to eq "Products::MensShoes::Fields::Active" }
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
context "base product class" do
|
64
|
+
subject { ::Product.fields }
|
65
|
+
|
66
|
+
describe "#all" do
|
67
|
+
it { expect(subject.all).to_not have_key(:size) }
|
68
|
+
it { expect(subject.all).to have_key(:active) }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
context "struct fields", :postgres => true do
|
73
|
+
subject { ::Ecommerce::Products::MensShoes.fields }
|
74
|
+
|
75
|
+
it { expect(subject.all).to have_key(:custom_fields) }
|
76
|
+
it { expect(subject[:custom_fields].fields.all).to have_key(:size) }
|
77
|
+
|
78
|
+
describe "#to_schema" do
|
79
|
+
let(:expectation) do
|
80
|
+
subject::CustomFields::Fields::Size.names.map(&:to_sym)
|
81
|
+
end
|
82
|
+
|
83
|
+
it {
|
84
|
+
expect(subject[:custom_fields].fields[:size].to_schema["values"]).to eq expectation
|
85
|
+
}
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ::Trax::Model::Attributes::Types::Enum do
|
4
|
+
subject{ ::Products::MensShoes::Fields::Size }
|
5
|
+
|
6
|
+
let(:shoe_size_integer_values) { (1..7).to_a }
|
7
|
+
let(:names) { [:mens_6, :mens_7, :mens_8, :mens_9, :mens_10, :mens_11, :mens_12] }
|
8
|
+
|
9
|
+
it { expect(subject.values).to eq shoe_size_integer_values }
|
10
|
+
it { expect(subject.names.map(&:to_sym)).to eq names }
|
11
|
+
|
12
|
+
context "model" do
|
13
|
+
subject {
|
14
|
+
::Products::MensShoes.new
|
15
|
+
}
|
16
|
+
|
17
|
+
context "default value" do
|
18
|
+
it { subject.size.should eq :mens_9 }
|
19
|
+
end
|
20
|
+
|
21
|
+
context "search scopes" do
|
22
|
+
[ :mens_6, :mens_7, :mens_10 ].each_with_index do |enum_name|
|
23
|
+
let!(enum_name) do
|
24
|
+
::Products::MensShoes.create(:size => enum_name)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
subject { ::Products::MensShoes.all }
|
29
|
+
|
30
|
+
it { expect(subject.by_size(:mens_6, :mens_7)).to include(mens_6, mens_7) }
|
31
|
+
it { expect(subject.by_size(:mens_6, :mens_7)).to_not include(mens_10) }
|
32
|
+
end
|
33
|
+
|
34
|
+
context "dirty attributes" do
|
35
|
+
subject { ::Products::MensShoes.create(:size => :mens_6) }
|
36
|
+
|
37
|
+
context "it tracks changes providing the human readable name" do
|
38
|
+
before do
|
39
|
+
subject.size = :mens_7
|
40
|
+
end
|
41
|
+
|
42
|
+
it do
|
43
|
+
subject.size = :mens_7
|
44
|
+
expect(subject.changes["size"]).to eq [:mens_6, :mens_7]
|
45
|
+
end
|
46
|
+
|
47
|
+
it { expect(subject.size_was).to eq :mens_6 }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ::Trax::Model::Attributes::Types::Json, :postgres => true do
|
4
|
+
subject{ ::Ecommerce::Products::MensShoes::Fields::CustomFields }
|
5
|
+
|
6
|
+
it { expect(subject.new.primary_utility).to eq "Skateboarding" }
|
7
|
+
it { expect(subject.new.sole_material).to eq "" }
|
8
|
+
|
9
|
+
context "model" do
|
10
|
+
subject { ::Ecommerce::Products::MensShoes.new }
|
11
|
+
|
12
|
+
context "default values" do
|
13
|
+
it { subject.custom_fields.size.should eq :mens_9 }
|
14
|
+
end
|
15
|
+
|
16
|
+
context "search scopes" do
|
17
|
+
context "enum property" do
|
18
|
+
[ :mens_6, :mens_7, :mens_10 ].each_with_index do |enum_name|
|
19
|
+
let!(enum_name) do
|
20
|
+
::Ecommerce::Products::MensShoes.create(:custom_fields => { :size => enum_name })
|
21
|
+
end
|
22
|
+
end
|
23
|
+
subject { ::Ecommerce::Products::MensShoes.all }
|
24
|
+
|
25
|
+
it { expect(subject.by_custom_fields_size(:mens_6, :mens_7)).to include(mens_6, mens_7) }
|
26
|
+
it { expect(subject.by_custom_fields_size(:mens_6, :mens_7)).to_not include(mens_10) }
|
27
|
+
end
|
28
|
+
|
29
|
+
context "boolean property" do
|
30
|
+
[ :mens_6, :mens_7, :mens_10 ].each_with_index do |enum_name|
|
31
|
+
let!(enum_name) do
|
32
|
+
::Ecommerce::Products::MensShoes.create(:custom_fields => { :size => enum_name })
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
subject { ::Ecommerce::Products::MensShoes.all }
|
37
|
+
|
38
|
+
it { expect(subject.by_custom_fields_size(:mens_6, :mens_7)).to include(mens_6, mens_7) }
|
39
|
+
it { expect(subject.by_custom_fields_size(:mens_6, :mens_7)).to_not include(mens_10) }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
context "dirty attributes" do
|
44
|
+
subject { ::Ecommerce::Products::MensShoes.create(:custom_fields => { :size => :mens_6 }) }
|
45
|
+
|
46
|
+
context "it tracks changes providing the human readable name" do
|
47
|
+
before do
|
48
|
+
subject.custom_fields.size = :mens_7
|
49
|
+
end
|
50
|
+
|
51
|
+
it { expect(subject.changes["custom_fields"][0]["size"]).to eq :mens_6 }
|
52
|
+
it { expect(subject["custom_fields"]["size"]).to eq :mens_7 }
|
53
|
+
it { expect(subject.changed_attributes["custom_fields"]["size"]).to eq :mens_6 }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
context "validation" do
|
58
|
+
let(:subject_attributes) { {} }
|
59
|
+
subject { ::Ecommerce::ShippingAttributes.create(subject_attributes) }
|
60
|
+
|
61
|
+
context "invalid struct attribute" do
|
62
|
+
subject { ::Ecommerce::ShippingAttributes.create(subject_attributes) }
|
63
|
+
|
64
|
+
let(:subject_attributes) { { :specifics => {:cost => "asdasd", :dimensions => {}}} }
|
65
|
+
|
66
|
+
it { expect(subject.valid?).to eq false }
|
67
|
+
it { expect(subject.errors.messages).to have_key(:"specifics.cost") }
|
68
|
+
end
|
69
|
+
|
70
|
+
context "valid struct attribute" do
|
71
|
+
let(:subject_attributes) { { :specifics => { :cost => "asdasdasdasdasd", :dimensions => {}}} }
|
72
|
+
|
73
|
+
it { expect(subject.valid?).to eq true }
|
74
|
+
end
|
75
|
+
|
76
|
+
context "enum_property coercing" do
|
77
|
+
context "valid enum value" do
|
78
|
+
context "value is symbol" do
|
79
|
+
let(:subject_attributes) { { :specifics => { :service => :usps } } }
|
80
|
+
|
81
|
+
it { expect(subject.specifics.service.to_i).to eq 1 }
|
82
|
+
end
|
83
|
+
|
84
|
+
context "value is symbol" do
|
85
|
+
let(:subject_attributes) { { :specifics => { :service => "usps" } } }
|
86
|
+
|
87
|
+
it { expect(subject.specifics.service.to_i).to eq 1 }
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
context "invalid enum attributes" do
|
92
|
+
context "out of range integer" do
|
93
|
+
let(:subject_attributes) { { :specifics => { :service => 20 } } }
|
94
|
+
|
95
|
+
it { expect(subject.specifics.service).to eq nil }
|
96
|
+
end
|
97
|
+
|
98
|
+
context "non existent string" do
|
99
|
+
let(:subject_attributes) { { :specifics => { :service => "sasdasd" } } }
|
100
|
+
|
101
|
+
it { expect(subject.specifics.service).to eq nil }
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ::Trax::Model::Attributes do
|
4
|
+
subject{ described_class }
|
5
|
+
|
6
|
+
describe ".register_attribute_type" do
|
7
|
+
[:array, :boolean, :enum, :json, :string, :uuid_array].each do |type|
|
8
|
+
it "registers attribute type #{type}" do
|
9
|
+
expect(subject.config.attribute_types).to have_key(type)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -12,5 +12,5 @@ describe ::Trax::Model::Struct do
|
|
12
12
|
|
13
13
|
its("name") { should eq "watches" }
|
14
14
|
its("meta_attributes.description") { should eq "Watches and stuff" }
|
15
|
-
its("meta_attributes.class") { should eq StoreCategory::
|
15
|
+
its("meta_attributes.class") { should eq StoreCategory::Fields::MetaAttributes }
|
16
16
|
end
|
@@ -2,9 +2,7 @@ require 'spec_helper'
|
|
2
2
|
describe ::Trax::Model::UniqueId do
|
3
3
|
subject{ ::Product }
|
4
4
|
|
5
|
-
its(:uuid_prefix) {
|
6
|
-
should be_instance_of(::Trax::Model::UUIDPrefix)
|
7
|
-
}
|
5
|
+
its(:uuid_prefix) { should be_instance_of(::Trax::Model::UUIDPrefix) }
|
8
6
|
|
9
7
|
describe "uuid_prefix" do
|
10
8
|
context "bad prefixes" do
|
@@ -5,7 +5,7 @@ describe ::UrlValidator do
|
|
5
5
|
|
6
6
|
its(:valid?) { should eq true }
|
7
7
|
|
8
|
-
["www.initech.com"
|
8
|
+
["www.initech.com"].each do |bad_url|
|
9
9
|
it "should fail validation for #{bad_url}" do
|
10
10
|
widget = ::Widget.create(:website => bad_url)
|
11
11
|
widget.errors.messages.should have_key(:website)
|
data/trax_model.gemspec
CHANGED
@@ -18,11 +18,11 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "trax_core", "~> 0.0.
|
21
|
+
spec.add_dependency "trax_core", "~> 0.0.74"
|
22
22
|
spec.add_dependency "default_value_for", "~> 3.0.0"
|
23
23
|
spec.add_dependency "simple_enum"
|
24
|
-
spec.add_development_dependency "hashie", "
|
25
|
-
spec.add_development_dependency "activerecord"
|
24
|
+
spec.add_development_dependency "hashie", ">= 3.4.2"
|
25
|
+
spec.add_development_dependency "activerecord", "~> 4.2.0"
|
26
26
|
spec.add_development_dependency "bundler", "~> 1.6"
|
27
27
|
spec.add_development_dependency "rake"
|
28
28
|
spec.add_development_dependency "sqlite3"
|
@@ -32,10 +32,10 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency "simplecov"
|
33
33
|
spec.add_development_dependency 'rspec-its', '~> 1'
|
34
34
|
spec.add_development_dependency 'rspec-collection_matchers', '~> 1'
|
35
|
+
spec.add_development_dependency "pg"
|
35
36
|
spec.add_development_dependency 'guard', '~> 2'
|
36
37
|
spec.add_development_dependency 'guard-rspec', '~> 4'
|
37
38
|
spec.add_development_dependency 'guard-bundler', '~> 2'
|
38
39
|
spec.add_development_dependency 'rb-fsevent'
|
39
40
|
spec.add_development_dependency 'terminal-notifier-guard'
|
40
|
-
|
41
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trax_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.93
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Ayre
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trax_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.
|
19
|
+
version: 0.0.74
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.
|
26
|
+
version: 0.0.74
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: default_value_for
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,30 +56,30 @@ dependencies:
|
|
56
56
|
name: hashie
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.4.
|
61
|
+
version: 3.4.2
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3.4.
|
68
|
+
version: 3.4.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: activerecord
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 4.2.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 4.2.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,6 +206,20 @@ dependencies:
|
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '1'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: pg
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
209
223
|
- !ruby/object:Gem::Dependency
|
210
224
|
name: guard
|
211
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -294,22 +308,29 @@ files:
|
|
294
308
|
- lib/trax.rb
|
295
309
|
- lib/trax/model.rb
|
296
310
|
- lib/trax/model/attributes.rb
|
311
|
+
- lib/trax/model/attributes/attribute.rb
|
297
312
|
- lib/trax/model/attributes/definitions.rb
|
298
313
|
- lib/trax/model/attributes/errors.rb
|
314
|
+
- lib/trax/model/attributes/fields.rb
|
299
315
|
- lib/trax/model/attributes/mixin.rb
|
300
316
|
- lib/trax/model/attributes/type.rb
|
301
317
|
- lib/trax/model/attributes/types.rb
|
302
318
|
- lib/trax/model/attributes/types/array.rb
|
319
|
+
- lib/trax/model/attributes/types/boolean.rb
|
303
320
|
- lib/trax/model/attributes/types/enum.rb
|
304
321
|
- lib/trax/model/attributes/types/json.rb
|
322
|
+
- lib/trax/model/attributes/types/string.rb
|
305
323
|
- lib/trax/model/attributes/types/uuid_array.rb
|
306
324
|
- lib/trax/model/attributes/value.rb
|
307
|
-
- lib/trax/model/config.rb
|
308
325
|
- lib/trax/model/enum.rb
|
309
326
|
- lib/trax/model/errors.rb
|
310
327
|
- lib/trax/model/freezable.rb
|
311
328
|
- lib/trax/model/matchable.rb
|
312
329
|
- lib/trax/model/mixin.rb
|
330
|
+
- lib/trax/model/mixins.rb
|
331
|
+
- lib/trax/model/mixins/field_scopes.rb
|
332
|
+
- lib/trax/model/mixins/id_scopes.rb
|
333
|
+
- lib/trax/model/mixins/sort_by_scopes.rb
|
313
334
|
- lib/trax/model/mti.rb
|
314
335
|
- lib/trax/model/mti/abstract.rb
|
315
336
|
- lib/trax/model/mti/entity.rb
|
@@ -317,6 +338,7 @@ files:
|
|
317
338
|
- lib/trax/model/railtie.rb
|
318
339
|
- lib/trax/model/registry.rb
|
319
340
|
- lib/trax/model/restorable.rb
|
341
|
+
- lib/trax/model/scopes.rb
|
320
342
|
- lib/trax/model/sti.rb
|
321
343
|
- lib/trax/model/sti/attributes.rb
|
322
344
|
- lib/trax/model/struct.rb
|
@@ -324,24 +346,32 @@ files:
|
|
324
346
|
- lib/trax/model/uuid.rb
|
325
347
|
- lib/trax/model/uuid_array.rb
|
326
348
|
- lib/trax/model/uuid_prefix.rb
|
327
|
-
- lib/trax/model/validators.rb
|
328
349
|
- lib/trax/string.rb
|
329
350
|
- lib/trax/validators/boolean_validator.rb
|
330
351
|
- lib/trax/validators/email_validator.rb
|
331
|
-
- lib/trax/validators/
|
352
|
+
- lib/trax/validators/enum_attribute_validator.rb
|
332
353
|
- lib/trax/validators/frozen_validator.rb
|
333
354
|
- lib/trax/validators/future_validator.rb
|
334
355
|
- lib/trax/validators/json_attribute_validator.rb
|
356
|
+
- lib/trax/validators/string_attribute_validator.rb
|
335
357
|
- lib/trax/validators/subdomain_validator.rb
|
336
358
|
- lib/trax/validators/url_validator.rb
|
337
359
|
- lib/trax_model.rb
|
338
360
|
- lib/trax_model/version.rb
|
361
|
+
- spec/db/database.yml
|
362
|
+
- spec/db/schema/default_tables.rb
|
363
|
+
- spec/db/schema/pg_tables.rb
|
339
364
|
- spec/spec_helper.rb
|
340
|
-
- spec/support/
|
341
|
-
- spec/
|
365
|
+
- spec/support/models.rb
|
366
|
+
- spec/support/pg/models.rb
|
367
|
+
- spec/trax/model/attributes/fields_spec.rb
|
368
|
+
- spec/trax/model/attributes/types/enum_spec.rb
|
369
|
+
- spec/trax/model/attributes/types/json_spec.rb
|
370
|
+
- spec/trax/model/attributes_spec.rb
|
342
371
|
- spec/trax/model/errors_spec.rb
|
343
372
|
- spec/trax/model/freezable_spec.rb
|
344
373
|
- spec/trax/model/matchable_spec.rb
|
374
|
+
- spec/trax/model/mixins/field_scopes_spec.rb
|
345
375
|
- spec/trax/model/registry_spec.rb
|
346
376
|
- spec/trax/model/restorable_spec.rb
|
347
377
|
- spec/trax/model/sti/attributes_spec.rb
|
@@ -381,12 +411,20 @@ signing_key:
|
|
381
411
|
specification_version: 4
|
382
412
|
summary: Higher level ActiveRecord models for rails
|
383
413
|
test_files:
|
414
|
+
- spec/db/database.yml
|
415
|
+
- spec/db/schema/default_tables.rb
|
416
|
+
- spec/db/schema/pg_tables.rb
|
384
417
|
- spec/spec_helper.rb
|
385
|
-
- spec/support/
|
386
|
-
- spec/
|
418
|
+
- spec/support/models.rb
|
419
|
+
- spec/support/pg/models.rb
|
420
|
+
- spec/trax/model/attributes/fields_spec.rb
|
421
|
+
- spec/trax/model/attributes/types/enum_spec.rb
|
422
|
+
- spec/trax/model/attributes/types/json_spec.rb
|
423
|
+
- spec/trax/model/attributes_spec.rb
|
387
424
|
- spec/trax/model/errors_spec.rb
|
388
425
|
- spec/trax/model/freezable_spec.rb
|
389
426
|
- spec/trax/model/matchable_spec.rb
|
427
|
+
- spec/trax/model/mixins/field_scopes_spec.rb
|
390
428
|
- spec/trax/model/registry_spec.rb
|
391
429
|
- spec/trax/model/restorable_spec.rb
|
392
430
|
- spec/trax/model/sti/attributes_spec.rb
|