abstractor 4.1.1 → 4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/stylesheets/abstractor/{abstractor_abstractions.css → abstractor_abstractions.css.scss} +2 -2
- data/app/assets/stylesheets/abstractor/{application.css → application.css.scss} +0 -0
- data/app/assets/stylesheets/abstractor/jquery.ui.override.css.scss +2 -2
- data/app/views/abstractor/abstractor_abstractions/_fields.html.haml +3 -4
- data/app/views/abstractor/abstractor_abstractions/edit.html.haml +5 -7
- data/db/migrate/20141120044606_add_system_generated_to_abstractor_abstraction_groups.rb +5 -0
- data/db/migrate/20150110002921_create_indexes_for_performance.rb +27 -0
- data/lib/abstractor/abstractable.rb +9 -9
- data/lib/abstractor/methods/models/abstractor_abstraction_group.rb +1 -1
- data/lib/abstractor/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjQyY2M5OTQwNjg5YjliODI4MGE5YzQ4ODI2MWQxNDZkZjlhNzNlMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Zjc4ODNkNjU1MDI2OGVkNWNjNWI2MTQ3OGRjYjM5YjAwZmVjYmUxZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2E1ZTcwZjZmNDg5NjNhMDcwNWE5OGFjNjcyY2Y1M2E1ZWE3YWE3ZjkzMTVh
|
10
|
+
YzBlYmI3ZjFmNmFhYThiMGExNWExZjBjZjNmMTM0ZWRmMWU1OWJlZWY2MTMz
|
11
|
+
MWIyOWU5ZDgzNzlmMjVkMWVjM2RlYTg4MmYwNGUxNjMzNTFhYTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjE4YzhiNzkwNmI0N2RkN2MyYzc4ZjI1MzAyMWUyMWVmMTEzZDkyMjUxNjlk
|
14
|
+
NmQyODQ2NDI0Y2M1ZGU2OTUwNjBjYjVjMDEwZTc4NzAyNWI5MzcxZDg1Zjll
|
15
|
+
YjhlYWNiNjZkYTIxNDFkYWVjZThkNjY5MjVhYTM0ODhhMmEyOGY=
|
@@ -141,14 +141,14 @@
|
|
141
141
|
margin-left: 5px;
|
142
142
|
}
|
143
143
|
.abstractor_abstractions fieldset .abstractor_abstraction_source_tooltip_img i {
|
144
|
-
background:
|
144
|
+
background: asset_url('abstractor/page.png') no-repeat;
|
145
145
|
vertical-align: text-bottom;
|
146
146
|
padding: 2px 10px;
|
147
147
|
vertical-align: middle;
|
148
148
|
}
|
149
149
|
|
150
150
|
.abstractor_abstractions fieldset .abstractor_abstraction_source_tooltip_img i.abstraction_text_link_match {
|
151
|
-
background:
|
151
|
+
background: asset_url('abstractor/page_green.png') no-repeat;
|
152
152
|
}
|
153
153
|
|
154
154
|
.abstractor_abstractions fieldset .hidden {
|
File without changes
|
@@ -59,14 +59,14 @@ table.ui-datepicker-calendar td {
|
|
59
59
|
}
|
60
60
|
.accordion_box h3 a,
|
61
61
|
.accordion_box h3 a.visible {
|
62
|
-
background: #DDDDDD
|
62
|
+
background: #DDDDDD asset_url('abstractor/switch_minus.gif') 1% 50% no-repeat;
|
63
63
|
padding-left: 3%;
|
64
64
|
display:block;
|
65
65
|
border:none;
|
66
66
|
}
|
67
67
|
.accordion_box h3 a.hidden,
|
68
68
|
.accordion_box h3 a.hidden:hover {
|
69
|
-
background-image:
|
69
|
+
background-image: asset_url('abstractor/switch_plus.gif');
|
70
70
|
}
|
71
71
|
.accordion_box h3 a:hover {
|
72
72
|
color: black;
|
@@ -56,11 +56,10 @@
|
|
56
56
|
- else
|
57
57
|
- abstractor_abstraction.abstractor_subject.abstractor_abstraction_sources.select { |s| s.abstractor_abstraction_source_type.name == 'nlp suggestion' }.each do |abstractor_abstraction_source|
|
58
58
|
- abstractor_abstraction_source.normalize_from_method_to_sources(abstractor_abstraction.about).each do |source|
|
59
|
-
-
|
60
|
-
|
59
|
+
- abstractor_text = Abstractor::AbstractorAbstractionSource.abstractor_text(source)
|
60
|
+
- dom_id = "#{abstractor_abstraction_source.id}_#{source[:source_type]}_#{source[:source_id]}_#{source[:source_method]}#{'_'+ source[:section_name].parameterize.underscore if source[:section_name]}"
|
61
|
+
%span{ class: 'abstractor_abstraction_source_tooltip_img', rel: "#abstraction_text_#{dom_id}", title: "#{source[:source_type].to_s} #{source[:source_method]} #{source[:section_name]}"}
|
61
62
|
%i{ id: "abstraction_text_link_#{dom_id}" }
|
62
|
-
%br
|
63
63
|
%div{ id: "abstraction_text_#{dom_id}", class: 'tooltip'}
|
64
|
-
- abstractor_text = Abstractor::AbstractorAbstractionSource.abstractor_text(source)
|
65
64
|
= simple_format(abstractor_text)
|
66
65
|
.clear
|
@@ -46,13 +46,11 @@
|
|
46
46
|
- abstraction_sources.each do |abstraction_source|
|
47
47
|
- abstraction_source.normalize_from_method_to_sources(abstractor_abstraction.about).each do |source|
|
48
48
|
- abstractor_text = Abstractor::AbstractorAbstractionSource.abstractor_text(source)
|
49
|
-
- if
|
50
|
-
|
51
|
-
%
|
52
|
-
|
53
|
-
|
54
|
-
%div{ :id => "abstraction_text_#{dom_id}", :class => 'tooltip'}
|
55
|
-
= simple_format(abstractor_text)
|
49
|
+
- dom_id = "#{abstraction_source.id}_#{source[:source_type]}_#{source[:source_id]}_#{source[:source_method]}#{'_'+ source[:section_name].parameterize.underscore if source[:section_name]}"
|
50
|
+
%span{ class: 'abstractor_abstraction_source_tooltip_img', rel: "#abstraction_text_#{dom_id}", title: "#{source[:source_type]} #{source[:source_method]} #{source[:section_name]}"}
|
51
|
+
%i{ id: "abstraction_text_link_#{dom_id}" }
|
52
|
+
%div{ id: "abstraction_text_#{dom_id}", class: 'abstractor_abstraction_source_tooltip'}
|
53
|
+
= simple_format(abstractor_text)
|
56
54
|
.abstraction_edit_abstraction_actions
|
57
55
|
= f.submit 'Save'
|
58
56
|
= link_to 'Cancel', abstractor_abstraction, :remote => true
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class CreateIndexesForPerformance < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
#abstractor_abstraction_group_members
|
4
|
+
add_index :abstractor_abstraction_group_members, [:abstractor_abstraction_id], unique: false , name: 'index_abstractor_abstraction_id'
|
5
|
+
add_index :abstractor_abstraction_group_members, [:abstractor_abstraction_group_id], unique: false , name: 'index_abstractor_abstraction_group_id'
|
6
|
+
|
7
|
+
#abstractor_abstraction_groups
|
8
|
+
add_index :abstractor_abstraction_groups, [:about_id, :about_type, :deleted_at], unique: false , name: 'index_about_id_about_type_deleted_at'
|
9
|
+
|
10
|
+
#abstractor_abstractions
|
11
|
+
add_index :abstractor_abstractions, [:about_id, :about_type, :deleted_at], unique: false , name: 'index_about_id_about_type_deleted_at_2'
|
12
|
+
add_index :abstractor_abstractions, [:abstractor_subject_id], unique: false , name: 'index_abstractor_subject_id'
|
13
|
+
|
14
|
+
#abstractor_subject_group_members
|
15
|
+
add_index :abstractor_subject_group_members, [:abstractor_subject_id], unique: false , name: 'index_abstractor_subject_id_2'
|
16
|
+
|
17
|
+
#abstractor_subjects
|
18
|
+
add_index :abstractor_subjects, [:subject_type], unique: false , name: 'index_subject_type'
|
19
|
+
add_index :abstractor_subjects, [:namespace_type, :namespace_id], unique: false , name: 'index_namespace_type_namespace_id'
|
20
|
+
|
21
|
+
#abstractor_suggestion_sources
|
22
|
+
add_index :abstractor_suggestion_sources, [:abstractor_suggestion_id], unique: false , name: 'index_abstractor_suggestion_id'
|
23
|
+
|
24
|
+
#abstractor_suggestions
|
25
|
+
add_index :abstractor_suggestions, [:abstractor_abstraction_id], unique: false , name: 'index_abstractor_abstraction_id_2'
|
26
|
+
end
|
27
|
+
end
|
@@ -24,11 +24,11 @@ module Abstractor
|
|
24
24
|
# @return [ActiveRecord::Relation] List of [Abstractor::AbstractorAbstraction].
|
25
25
|
def abstractor_abstractions_by_namespace(options = {})
|
26
26
|
options = { namespace_type: nil, namespace_id: nil }.merge(options)
|
27
|
+
abstractions = abstractor_abstractions.not_deleted
|
27
28
|
if options[:namespace_type] || options[:namespace_id]
|
28
|
-
|
29
|
-
else
|
30
|
-
abstractor_abstractions.not_deleted
|
29
|
+
abstractions = abstractions.where(abstractor_subject_id: self.class.abstractor_subjects(options).map(&:id))
|
31
30
|
end
|
31
|
+
abstractions
|
32
32
|
end
|
33
33
|
##
|
34
34
|
# Returns all abstraction groups for the abstractable entity by a namespace.
|
@@ -40,7 +40,7 @@ module Abstractor
|
|
40
40
|
def abstractor_abstraction_groups_by_namespace(options = {})
|
41
41
|
options = { namespace_type: nil, namespace_id: nil }.merge(options)
|
42
42
|
if options[:namespace_type] || options[:namespace_id]
|
43
|
-
groups = abstractor_abstractions_by_namespace(options).
|
43
|
+
groups = abstractor_abstraction_groups.find(abstractor_abstractions_by_namespace(options).joins(:abstractor_abstraction_group).includes(:abstractor_abstraction_group).map{|s| s.abstractor_abstraction_group.id})
|
44
44
|
else
|
45
45
|
groups = abstractor_abstraction_groups.not_deleted
|
46
46
|
end
|
@@ -99,7 +99,7 @@ module Abstractor
|
|
99
99
|
def find_or_initialize_abstractor_abstraction_group(abstractor_subject_group)
|
100
100
|
if abstractor_abstraction_group = detect_abstractor_abstraction_group(abstractor_subject_group)
|
101
101
|
else
|
102
|
-
abstractor_abstraction_group = Abstractor::AbstractorAbstractionGroup.new(abstractor_subject_group: abstractor_subject_group, about: self)
|
102
|
+
abstractor_abstraction_group = Abstractor::AbstractorAbstractionGroup.new(abstractor_subject_group: abstractor_subject_group, about: self, system_generated: true)
|
103
103
|
end
|
104
104
|
abstractor_abstraction_group
|
105
105
|
end
|
@@ -219,13 +219,13 @@ module Abstractor
|
|
219
219
|
options = { grouped: nil, namespace_type: nil, namespace_id: nil }.merge(options)
|
220
220
|
subjects = Abstractor::AbstractorSubject.where(subject_type: self.to_s)
|
221
221
|
if options[:namespace_type] || options[:namespace_id]
|
222
|
-
subjects = subjects.
|
222
|
+
subjects = subjects.where(namespace_type: options[:namespace_type], namespace_id: options[:namespace_id])
|
223
223
|
end
|
224
224
|
subjects = case options[:grouped]
|
225
225
|
when true
|
226
|
-
subjects.
|
226
|
+
subjects.joins(:abstractor_subject_group).includes(:abstractor_subject_group)
|
227
227
|
when false
|
228
|
-
subjects.
|
228
|
+
subjects.where("not exists (select 'a' from abstractor_subject_group_members where abstractor_subject_id = abstractor_subjects.id)")
|
229
229
|
when nil
|
230
230
|
subjects
|
231
231
|
end
|
@@ -248,7 +248,7 @@ module Abstractor
|
|
248
248
|
|
249
249
|
def abstractor_subject_groups(options = {})
|
250
250
|
options = { grouped: true, namespace_type: nil, namespace_id: nil }.merge(options)
|
251
|
-
abstractor_subjects(options).map
|
251
|
+
Abstractor::AbstractorSubjectGroup.find(abstractor_subjects(options).map{|s| s.abstractor_subject_group.id})
|
252
252
|
end
|
253
253
|
|
254
254
|
##
|
data/lib/abstractor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abstractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Gurley, Yulia Bushmanova
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -442,8 +442,8 @@ files:
|
|
442
442
|
- app/assets/javascripts/abstractor/application.js
|
443
443
|
- app/assets/javascripts/abstractor/combobox.js
|
444
444
|
- app/assets/javascripts/abstractor/jquery/jquery.form.js
|
445
|
-
- app/assets/stylesheets/abstractor/abstractor_abstractions.css
|
446
|
-
- app/assets/stylesheets/abstractor/application.css
|
445
|
+
- app/assets/stylesheets/abstractor/abstractor_abstractions.css.scss
|
446
|
+
- app/assets/stylesheets/abstractor/application.css.scss
|
447
447
|
- app/assets/stylesheets/abstractor/jquery.ui.override.css.scss
|
448
448
|
- app/controllers/abstractor/abstractor_abstraction_groups_controller.rb
|
449
449
|
- app/controllers/abstractor/abstractor_abstractions_controller.rb
|
@@ -517,6 +517,8 @@ files:
|
|
517
517
|
- db/migrate/20140816005228_add_namespace_to_abstractor_subjects.rb
|
518
518
|
- db/migrate/20141028020332_add_cardinality_to_abstractor_subject_group.rb
|
519
519
|
- db/migrate/20141107171413_add_sectioning.rb
|
520
|
+
- db/migrate/20141120044606_add_system_generated_to_abstractor_abstraction_groups.rb
|
521
|
+
- db/migrate/20150110002921_create_indexes_for_performance.rb
|
520
522
|
- db/seeds.rb
|
521
523
|
- lib/abstractor.rb
|
522
524
|
- lib/abstractor/abstractable.rb
|