iqvoc_compound_forms 2.1.0 → 2.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c3123e934612bf60b88ce42c5ccac54bb77a2b2
4
- data.tar.gz: 6f14c5f40d2845ee1a74501b4f3e2d64f7b2e5b1
3
+ metadata.gz: db63281682343b4d6ddcbba81e56ff15c60eac87
4
+ data.tar.gz: 2ae19c8f1743531271a235d57d6d60d1f1fab6cf
5
5
  SHA512:
6
- metadata.gz: cd047955e34c1d7cd38b0e013b2916767b83fa9c6529d7a65118dc53a95e204ff2d53ea69521ce73d77c95702db44d3b08e02056e0d6d7dbfa663c7161782ec6
7
- data.tar.gz: bc76274d1763e711f66f914e99c86a4eb2ca39314365a655eb806eccd44899ec257cc3ff138eb139d075467ea3806ed6628788c9d22520587e7a00b7205e1415
6
+ metadata.gz: b92c0f6f6959d41d5a44367ac1c285670a3a7ec2da2d6f5635e944fbd39eace801cfffc8ea87d9f97e28dc193437aa0d224272bc72da841221b609eb09968015
7
+ data.tar.gz: 218bb6995130986aafd802f43a6dbbca36c520fe241136c5f85500a57f1713a415c5f1ad2533163f9999f47875aaf1aa658c181eb6e6c8b447216311e92623b7
data/.gitignore CHANGED
@@ -2,6 +2,7 @@
2
2
  /log
3
3
  /tmp
4
4
  /db/*.sqlite
5
+ /db/schema.rb
5
6
  /config/database.yml
6
7
  /config/initializers/secret_token.rb
7
8
  *.gem
@@ -1,19 +1,30 @@
1
+ language: ruby
2
+ cache: bundler
3
+ bundler_args:
1
4
  rvm:
2
- - 1.8.7
3
- - 1.9.2
4
- - 1.9.3
5
-
5
+ - 1.9.3
6
+ - 2.0
7
+ - 2.1
8
+ - jruby-19mode
6
9
  env:
7
- - DB=sqlite
8
- - DB=mysql
9
-
10
- before_script: ruby ./script/ci/travis_before_build.rb
11
- script: bundle exec rake iqvoc:setup:generate_secret_token db:drop db:create iqvoc:db:migrate_all test RAILS_ENV=test
12
-
10
+ - DB=sqlite
11
+ - DB=mysql
12
+ before_install: cp config/database.$DB.yml config/database.yml
13
+ before_script:
14
+ - bundle exec rake db:drop RAILS_ENV=test
15
+ - bundle exec rake db:create RAILS_ENV=test
16
+ - bundle exec rake db:migrate RAILS_ENV=test
13
17
  branches:
14
18
  only:
15
- - master
16
-
19
+ - master
17
20
  notifications:
18
- recipients:
19
- - iqvoc@innoq.com
21
+ email:
22
+ - iqvoc@innoq.com
23
+ deploy:
24
+ provider: rubygems
25
+ api_key:
26
+ secure: maEhwWkTskmPRX1BdqJXrpnKrtTKrBGoho33oFn70OD+Z51vHYuZxz5SYUyzEG/uL2R5QFlIReUFtibpnSZx1xvTnqZyxMWY8gvRaOhrgmGoKmGvtbqF9zABTv7K/ivY5Kkt6jo3jahvf4/eQ+bWKCnA0Ak1JpuWhbgxZY8hUGY=
27
+ gem: iqvoc_compound_forms
28
+ on:
29
+ tags: true
30
+ repo: innoq/iqvoc_compound_forms
data/Gemfile CHANGED
@@ -1,10 +1,13 @@
1
- source "http://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '~> 3.2.13'
4
- gem 'iqvoc', :git => 'git://github.com/innoq/iqvoc.git'
5
- gem 'iqvoc_skosxl', :git => 'git://github.com/innoq/iqvoc_skosxl.git'
3
+ gem 'iqvoc', '~> 4.6.0', :github => 'innoq/iqvoc'
4
+ gem 'iqvoc_skosxl', '~> 2.5.0', :github => 'innoq/iqvoc_skosxl'
6
5
 
7
6
  group :development, :test do
7
+ gem 'spring'
8
+ gem 'pry-rails'
9
+ gem 'awesome_print'
10
+
8
11
  platforms :ruby do
9
12
  gem 'mysql2'
10
13
  gem 'sqlite3'
@@ -1,141 +1,299 @@
1
1
  GIT
2
2
  remote: git://github.com/innoq/iqvoc.git
3
- revision: 77c24b3613951ce84e4a65db2f04b53c278aa0b6
3
+ revision: fe2356c73c1acc920c56649d33bff8ddb9185aaf
4
4
  specs:
5
- iqvoc (4.1.0)
6
- authlogic
5
+ iqvoc (4.6.0)
6
+ apipie-rails
7
+ authlogic (~> 3.4.2)
8
+ bootstrap-sass (~> 3.1.1.0)
9
+ bootstrap_form (~> 2.1.1)
7
10
  bundler
8
- cancan
9
- iq_rdf (~> 0.1.2)
11
+ cancancan
12
+ carrierwave
13
+ database_cleaner
14
+ delayed_job_active_record (~> 4.0.1)
15
+ faraday
16
+ faraday_middleware
17
+ font-awesome-rails
18
+ iq_rdf (>= 0.1.15)
10
19
  iq_triplestorage
11
20
  json
12
21
  kaminari
13
- rails (~> 3.2.1)
22
+ kaminari-bootstrap (~> 3.0.1)
23
+ linkeddata
24
+ maruku
25
+ nokogiri
26
+ rails (~> 4.1.0)
14
27
  rails_autolink
15
- sass-rails (~> 3.2.5)
16
- simple_form
28
+ sass-rails (~> 4.0.2)
29
+ uglifier (>= 1.3.0)
17
30
 
18
31
  GIT
19
32
  remote: git://github.com/innoq/iqvoc_skosxl.git
20
- revision: 0cb62cff5782f48e7f88a90803b3548497317f97
33
+ revision: 6775e81428fdf2c0ea6c775b98f9292459ad9ead
21
34
  specs:
22
- iqvoc_skosxl (2.0.2)
23
- bundler
24
- iqvoc (~> 4.1.0)
35
+ iqvoc_skosxl (2.5.0)
36
+ iqvoc (~> 4.6, >= 4.5.0)
25
37
 
26
38
  GEM
27
- remote: http://rubygems.org/
39
+ remote: https://rubygems.org/
28
40
  specs:
29
- actionmailer (3.2.13)
30
- actionpack (= 3.2.13)
31
- mail (~> 2.5.3)
32
- actionpack (3.2.13)
33
- activemodel (= 3.2.13)
34
- activesupport (= 3.2.13)
35
- builder (~> 3.0.0)
41
+ actionmailer (4.1.6)
42
+ actionpack (= 4.1.6)
43
+ actionview (= 4.1.6)
44
+ mail (~> 2.5, >= 2.5.4)
45
+ actionpack (4.1.6)
46
+ actionview (= 4.1.6)
47
+ activesupport (= 4.1.6)
48
+ rack (~> 1.5.2)
49
+ rack-test (~> 0.6.2)
50
+ actionview (4.1.6)
51
+ activesupport (= 4.1.6)
52
+ builder (~> 3.1)
36
53
  erubis (~> 2.7.0)
37
- journey (~> 1.0.4)
38
- rack (~> 1.4.5)
39
- rack-cache (~> 1.2)
40
- rack-test (~> 0.6.1)
41
- sprockets (~> 2.2.1)
42
- activemodel (3.2.13)
43
- activesupport (= 3.2.13)
44
- builder (~> 3.0.0)
45
- activerecord (3.2.13)
46
- activemodel (= 3.2.13)
47
- activesupport (= 3.2.13)
48
- arel (~> 3.0.2)
49
- tzinfo (~> 0.3.29)
50
- activeresource (3.2.13)
51
- activemodel (= 3.2.13)
52
- activesupport (= 3.2.13)
53
- activesupport (3.2.13)
54
- i18n (= 0.6.1)
55
- multi_json (~> 1.0)
56
- arel (3.0.2)
57
- authlogic (3.3.0)
54
+ activemodel (4.1.6)
55
+ activesupport (= 4.1.6)
56
+ builder (~> 3.1)
57
+ activerecord (4.1.6)
58
+ activemodel (= 4.1.6)
59
+ activesupport (= 4.1.6)
60
+ arel (~> 5.0.0)
61
+ activerecord-jdbc-adapter (1.3.7)
62
+ activerecord (>= 2.2)
63
+ activerecord-jdbcmysql-adapter (1.3.7)
64
+ activerecord-jdbc-adapter (~> 1.3.7)
65
+ jdbc-mysql (>= 5.1.22)
66
+ activerecord-jdbcsqlite3-adapter (1.3.7)
67
+ activerecord-jdbc-adapter (~> 1.3.7)
68
+ jdbc-sqlite3 (~> 3.7.2)
69
+ activesupport (4.1.6)
70
+ i18n (~> 0.6, >= 0.6.9)
71
+ json (~> 1.7, >= 1.7.7)
72
+ minitest (~> 5.1)
73
+ thread_safe (~> 0.1)
74
+ tzinfo (~> 1.1)
75
+ apipie-rails (0.2.6)
76
+ json
77
+ arel (5.0.1.20140414130214)
78
+ authlogic (3.4.3)
58
79
  activerecord (>= 3.2)
59
80
  activesupport (>= 3.2)
60
- builder (3.0.4)
61
- cancan (1.6.9)
81
+ request_store (~> 1.0)
82
+ scrypt (~> 1.2)
83
+ awesome_print (1.2.0)
84
+ bootstrap-sass (3.1.1.1)
85
+ sass (~> 3.2)
86
+ bootstrap_form (2.1.1)
87
+ builder (3.2.2)
88
+ cancancan (1.9.2)
89
+ carrierwave (0.10.0)
90
+ activemodel (>= 3.2.0)
91
+ activesupport (>= 3.2.0)
92
+ json (>= 1.7)
93
+ mime-types (>= 1.16)
94
+ coderay (1.1.0)
95
+ database_cleaner (1.3.0)
96
+ delayed_job (4.0.4)
97
+ activesupport (>= 3.0, < 4.2)
98
+ delayed_job_active_record (4.0.2)
99
+ activerecord (>= 3.0, < 4.2)
100
+ delayed_job (>= 3.0, < 4.1)
101
+ ebnf (0.3.6)
102
+ haml (~> 4.0)
103
+ rdf (~> 1.1)
104
+ sxp (~> 0.1, >= 0.1.3)
105
+ equivalent-xml (0.5.1)
106
+ nokogiri (>= 1.4.3)
62
107
  erubis (2.7.0)
63
- hike (1.2.2)
64
- i18n (0.6.1)
65
- iq_rdf (0.1.10)
108
+ execjs (2.2.2)
109
+ faraday (0.9.0)
110
+ multipart-post (>= 1.2, < 3)
111
+ faraday_middleware (0.9.1)
112
+ faraday (>= 0.7.4, < 0.10)
113
+ ffi (1.9.3)
114
+ ffi (1.9.3-java)
115
+ ffi-compiler (0.1.3)
116
+ ffi (>= 1.0.0)
117
+ rake
118
+ font-awesome-rails (4.2.0.0)
119
+ railties (>= 3.2, < 5.0)
120
+ haml (4.0.5)
121
+ tilt
122
+ hike (1.2.3)
123
+ htmlentities (4.3.2)
124
+ i18n (0.6.11)
125
+ iq_rdf (0.1.15)
66
126
  activesupport
67
127
  builder
68
128
  bundler
69
129
  iq_triplestorage (0.2.2)
70
- journey (1.0.4)
71
- json (1.7.7)
72
- kaminari (0.14.1)
130
+ jdbc-mysql (5.1.30)
131
+ jdbc-sqlite3 (3.7.2.1)
132
+ json (1.8.1)
133
+ json (1.8.1-java)
134
+ json-ld (1.1.7)
135
+ rdf (~> 1.1, >= 1.1.4)
136
+ kaminari (0.16.1)
73
137
  actionpack (>= 3.0.0)
74
138
  activesupport (>= 3.0.0)
75
- mail (2.5.3)
76
- i18n (>= 0.4.0)
77
- mime-types (~> 1.16)
78
- treetop (~> 1.4.8)
79
- mime-types (1.22)
80
- multi_json (1.7.2)
81
- mysql2 (0.3.11)
82
- polyglot (0.3.3)
83
- rack (1.4.5)
84
- rack-cache (1.2)
85
- rack (>= 0.4)
86
- rack-ssl (1.3.3)
87
- rack
139
+ kaminari-bootstrap (3.0.1)
140
+ kaminari (>= 0.13.0)
141
+ rails
142
+ linkeddata (1.1.1)
143
+ equivalent-xml (>= 0.4.0)
144
+ json-ld (>= 1.1.1)
145
+ nokogiri (>= 1.6.1)
146
+ rdf (>= 1.1.1)
147
+ rdf-aggregate-repo (>= 1.1.0)
148
+ rdf-isomorphic (>= 1.1.0)
149
+ rdf-json (>= 1.1.0)
150
+ rdf-microdata (>= 1.1.1)
151
+ rdf-n3 (>= 1.1.0)
152
+ rdf-rdfa (>= 1.1.1)
153
+ rdf-rdfxml (>= 1.1.0)
154
+ rdf-trig (>= 1.1.2)
155
+ rdf-trix (>= 1.1.0)
156
+ rdf-turtle (>= 1.1.2)
157
+ sparql (>= 1.1.2)
158
+ sparql-client (>= 1.1.1)
159
+ mail (2.6.1)
160
+ mime-types (>= 1.16, < 3)
161
+ maruku (0.7.2)
162
+ method_source (0.8.2)
163
+ mime-types (2.4.3)
164
+ mini_portile (0.6.0)
165
+ minitest (5.4.2)
166
+ multi_json (1.10.1)
167
+ multipart-post (2.0.0)
168
+ mysql2 (0.3.16)
169
+ net-http-persistent (2.9.4)
170
+ nokogiri (1.6.3.1)
171
+ mini_portile (= 0.6.0)
172
+ nokogiri (1.6.3.1-java)
173
+ pry (0.9.12.6)
174
+ coderay (~> 1.0)
175
+ method_source (~> 0.8)
176
+ slop (~> 3.4)
177
+ pry (0.9.12.6-java)
178
+ coderay (~> 1.0)
179
+ method_source (~> 0.8)
180
+ slop (~> 3.4)
181
+ spoon (~> 0.0)
182
+ pry-rails (0.3.2)
183
+ pry (>= 0.9.10)
184
+ rack (1.5.2)
88
185
  rack-test (0.6.2)
89
186
  rack (>= 1.0)
90
- rails (3.2.13)
91
- actionmailer (= 3.2.13)
92
- actionpack (= 3.2.13)
93
- activerecord (= 3.2.13)
94
- activeresource (= 3.2.13)
95
- activesupport (= 3.2.13)
96
- bundler (~> 1.0)
97
- railties (= 3.2.13)
98
- rails_autolink (1.0.9)
99
- rails (~> 3.1)
100
- railties (3.2.13)
101
- actionpack (= 3.2.13)
102
- activesupport (= 3.2.13)
103
- rack-ssl (~> 1.3.2)
187
+ rails (4.1.6)
188
+ actionmailer (= 4.1.6)
189
+ actionpack (= 4.1.6)
190
+ actionview (= 4.1.6)
191
+ activemodel (= 4.1.6)
192
+ activerecord (= 4.1.6)
193
+ activesupport (= 4.1.6)
194
+ bundler (>= 1.3.0, < 2.0)
195
+ railties (= 4.1.6)
196
+ sprockets-rails (~> 2.0)
197
+ rails_autolink (1.1.6)
198
+ rails (> 3.1)
199
+ railties (4.1.6)
200
+ actionpack (= 4.1.6)
201
+ activesupport (= 4.1.6)
104
202
  rake (>= 0.8.7)
105
- rdoc (~> 3.4)
106
- thor (>= 0.14.6, < 2.0)
107
- rake (10.0.4)
108
- rdoc (3.12.2)
109
- json (~> 1.4)
110
- sass (3.2.7)
111
- sass-rails (3.2.6)
112
- railties (~> 3.2.0)
113
- sass (>= 3.1.10)
114
- tilt (~> 1.3)
115
- simple_form (2.1.0)
116
- actionpack (~> 3.0)
117
- activemodel (~> 3.0)
118
- sprockets (2.2.2)
203
+ thor (>= 0.18.1, < 2.0)
204
+ rake (10.3.2)
205
+ rdf (1.1.6)
206
+ rdf-aggregate-repo (1.1.0)
207
+ rdf (>= 1.1)
208
+ rdf-isomorphic (1.1.0)
209
+ rdf (>= 1.1)
210
+ rdf-json (1.1.0)
211
+ rdf (>= 1.1.0)
212
+ rdf-microdata (1.1.2)
213
+ htmlentities (~> 4.3)
214
+ nokogiri (~> 1.6)
215
+ rdf (~> 1.1)
216
+ rdf-xsd (~> 1.1)
217
+ rdf-n3 (1.1.2)
218
+ rdf (~> 1.1, >= 1.1.5)
219
+ rdf-rdfa (1.1.4.1)
220
+ haml (~> 4.0)
221
+ htmlentities (~> 4.3)
222
+ rdf (~> 1.1, >= 1.1.6)
223
+ rdf-xsd (~> 1.1)
224
+ rdf-rdfxml (1.1.3)
225
+ htmlentities (~> 4.3)
226
+ rdf (~> 1.1, >= 1.1.6)
227
+ rdf-rdfa (~> 1.1, >= 1.1.4.1)
228
+ rdf-xsd (~> 1.1)
229
+ rdf-trig (1.1.3.1)
230
+ ebnf (~> 0.3, >= 0.3.5)
231
+ rdf (~> 1.1, >= 1.1.2.1)
232
+ rdf-turtle (~> 1.1, >= 1.1.3)
233
+ rdf-trix (1.1.0)
234
+ rdf (>= 1.1)
235
+ rdf-turtle (1.1.4)
236
+ ebnf (~> 0.3, >= 0.3.6)
237
+ rdf (~> 1.1, >= 1.1.4)
238
+ rdf-xsd (1.1.2)
239
+ rdf (~> 1.1)
240
+ request_store (1.1.0)
241
+ sass (3.2.19)
242
+ sass-rails (4.0.3)
243
+ railties (>= 4.0.0, < 5.0)
244
+ sass (~> 3.2.0)
245
+ sprockets (~> 2.8, <= 2.11.0)
246
+ sprockets-rails (~> 2.0)
247
+ scrypt (1.2.1)
248
+ ffi-compiler (>= 0.0.2)
249
+ rake
250
+ slop (3.5.0)
251
+ sparql (1.1.4)
252
+ builder (~> 3.0)
253
+ ebnf (~> 0.3, >= 0.3.5)
254
+ rdf (~> 1.1, >= 1.1.4)
255
+ rdf-aggregate-repo (~> 1.1, >= 1.1.0)
256
+ rdf-xsd (~> 1.1)
257
+ sparql-client (~> 1.1)
258
+ sxp (~> 0.1)
259
+ sparql-client (1.1.3.1)
260
+ net-http-persistent (~> 2.9)
261
+ rdf (~> 1.1)
262
+ spoon (0.0.4)
263
+ ffi
264
+ spring (1.1.3)
265
+ sprockets (2.11.0)
119
266
  hike (~> 1.2)
120
267
  multi_json (~> 1.0)
121
268
  rack (~> 1.0)
122
269
  tilt (~> 1.1, != 1.3.0)
123
- sqlite3 (1.3.7)
124
- thor (0.18.1)
125
- tilt (1.3.7)
126
- treetop (1.4.12)
127
- polyglot
128
- polyglot (>= 0.3.1)
129
- tzinfo (0.3.37)
270
+ sprockets-rails (2.2.0)
271
+ actionpack (>= 3.0)
272
+ activesupport (>= 3.0)
273
+ sprockets (>= 2.8, < 4.0)
274
+ sqlite3 (1.3.9)
275
+ sxp (0.1.5)
276
+ thor (0.19.1)
277
+ thread_safe (0.3.4)
278
+ thread_safe (0.3.4-java)
279
+ tilt (1.4.1)
280
+ tzinfo (1.2.2)
281
+ thread_safe (~> 0.1)
282
+ uglifier (2.5.3)
283
+ execjs (>= 0.3.0)
284
+ json (>= 1.8.0)
130
285
 
131
286
  PLATFORMS
287
+ java
132
288
  ruby
133
289
 
134
290
  DEPENDENCIES
135
291
  activerecord-jdbcmysql-adapter
136
292
  activerecord-jdbcsqlite3-adapter
137
- iqvoc!
138
- iqvoc_skosxl!
293
+ awesome_print
294
+ iqvoc (~> 4.6.0)!
295
+ iqvoc_skosxl (~> 2.5.0)!
139
296
  mysql2
140
- rails (~> 3.2.13)
297
+ pry-rails
298
+ spring
141
299
  sqlite3
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
- Compound Forms for iQvoc
1
+ [![Build Status](https://travis-ci.org/innoq/iqvoc_compound_forms.svg?branch=master)](https://travis-ci.org/innoq/iqvoc_compound_forms)
2
2
 
3
+ Compound forms for iQvoc
3
4
 
4
5
  Getting Started
5
6
  ===============
@@ -7,7 +8,3 @@ Getting Started
7
8
  1. Initialize database:
8
9
 
9
10
  $ rake db:create iqvoc:db:migrate_all iqvoc:db:seed_all
10
-
11
- 2. Generate secret token:
12
-
13
- $ rake iqvoc:setup:generate_secret_token
@@ -2,8 +2,8 @@
2
2
 
3
3
  class CompoundForm::Base < ActiveRecord::Base
4
4
  class_attribute :rdf_namespace, :rdf_predicate
5
- self.rdf_namespace = 'umt'
6
- self.rdf_predicate = 'compoundForm'
5
+ self.rdf_namespace = 'iqvoc'
6
+ self.rdf_predicate = 'compoundFrom'
7
7
 
8
8
  self.table_name ='compound_forms'
9
9
 
@@ -15,7 +15,7 @@ class CompoundForm::Base < ActiveRecord::Base
15
15
  :dependent => :destroy
16
16
 
17
17
  def self.published
18
- includes(:domain).merge(Label::Base.published)
18
+ includes(:domain).references(:labels).merge(Label::Base.published)
19
19
  end
20
20
 
21
21
  def self.referenced_by(label_class)
@@ -42,8 +42,48 @@ class CompoundForm::Base < ActiveRecord::Base
42
42
  "partials/compound_form/edit_base"
43
43
  end
44
44
 
45
+ def self.build_from_rdf(rdf_subject, rdf_predicate, rdf_object)
46
+ unless rdf_subject.is_a? Label::SKOSXL::Base
47
+ raise "#{self.name}#build_from_rdf: Subject (#{rdf_subject}) must be a 'Label::SKOSXL::Base'"
48
+ end
49
+
50
+ target_class = Iqvoc::RDFAPI::PREDICATE_DICTIONARY[rdf_predicate] || self
51
+
52
+ ActiveRecord::Base.transaction do
53
+ begin
54
+ compound_form = target_class.create(domain: rdf_subject) # create compound form
55
+ create_compound_form_contents(rdf_object, compound_form)
56
+ rescue Exception => e
57
+ raise ActiveRecord::Rollback, e
58
+ end
59
+ end
60
+
61
+ end
62
+
45
63
  def build_rdf(document, subject)
46
- subject.Umt.compoundForm(compound_form_contents.map {|cfc| IqRdf::build_uri(cfc.label.origin) })
64
+ subject.send(rdf_namespace).send(rdf_predicate, compound_form_contents.map {|cfc| IqRdf::build_uri(cfc.label.origin) })
47
65
  end
48
66
 
67
+ private
68
+
69
+ def self.create_compound_form_contents(rdf_object, compound_form)
70
+ rdf_object.each do |obj|
71
+ case obj.last
72
+ when String # normal
73
+ if obj.last =~ /^:(.*)$/
74
+ # we are responsible for this (e.g. :computer-de)
75
+ label = Iqvoc::XLLabel.base_class.by_origin(obj.last[1..-1]).last # find label by origin, strip out leading ':'
76
+
77
+ if label
78
+ CompoundForm::Content::Base.create(label: label, compound_form: compound_form)
79
+ else
80
+ raise "#{self.name}#create_compound_form_contents: Could not create compound form content. Cannot find label with origin '#{obj.last}'"
81
+ end
82
+ end
83
+ when Array # another blank note
84
+ # call recursively
85
+ create_compound_form_contents(obj.last, compound_form)
86
+ end
87
+ end
88
+ end
49
89
  end
@@ -8,7 +8,7 @@ class CompoundForm::Content::Base < ActiveRecord::Base
8
8
  belongs_to :label, :class_name => 'Label::Base', :foreign_key => 'label_id'
9
9
 
10
10
  def self.label_published
11
- includes(:label).merge(Label::Base.published)
11
+ includes(:label).references(:labels).merge(Label::Base.published)
12
12
  end
13
13
 
14
14
  def self.target_in_edit_mode(domain_id)
@@ -1,17 +1,17 @@
1
1
  <div class="compound-form">
2
2
  <% items = Iqvoc::XLLabel.base_class.editor_selectable.
3
3
  by_origin(compound_form.compound_form_contents.
4
- map { |cfc| cfc.label.origin }) %>
4
+ map { |cfc| cfc.label.origin }).load %>
5
5
  <% fieldname = "label[inline_compound_form_origins][]" %>
6
- <%= f.input fieldname, :label => t('txt.common.type_to_search') do %>
7
- <%= text_field_tag fieldname, items.join(Iqvoc::InlineDataHelper::Joiner),
6
+ <%= f.form_group nil, :label => { :text => t('txt.common.type_to_search') } do %>
7
+ <%= text_field_tag fieldname, items.join(Iqvoc::InlineDataHelper::JOINER),
8
8
  :class => "entity_select",
9
9
  :"data-query-url" => labels_path(:format => :json),
10
10
  :"data-entity-uri" => label_path("{id}"),
11
11
  :"data-entities" => (not compound_form) ? nil : items.
12
12
  map { |l| label_widget_data(l) }.to_json %>
13
13
 
14
- <input type="button" class="btn add-compound-form" value="<%= t("txt.common.add_note") %>">
15
- <input type="button" class="btn rm-compound-form" value="<%= t("txt.common.delete") %>">
14
+ <input type="button" class="btn btn-default add-compound-form" value="<%= t("txt.common.add_note") %>">
15
+ <input type="button" class="btn btn-default rm-compound-form" value="<%= t("txt.common.delete") %>">
16
16
  <% end %>
17
17
  </div>
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
7
+
8
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
9
+ require File.expand_path('../../config/boot', __FILE__)
10
+ require 'rails/commands'
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ require 'bundler/setup'
7
+ load Gem.bin_path('rake', 'rake')
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast
4
+ # It gets overwritten when you run the `spring binstub` command
5
+
6
+ unless defined?(Spring)
7
+ require "rubygems"
8
+ require "bundler"
9
+
10
+ if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
11
+ ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
12
+ ENV["GEM_HOME"] = ""
13
+ Gem.paths = ENV
14
+
15
+ gem "spring", match[1]
16
+ require "spring/binstub"
17
+ end
18
+ end
@@ -1,20 +1,20 @@
1
1
  development:
2
2
  adapter: mysql2
3
- database: iqvoc_skosxl_development
3
+ database: iqvoc_compound_forms_development
4
4
  username: root
5
5
  password:
6
6
  encoding: utf8
7
7
 
8
8
  test:
9
9
  adapter: mysql2
10
- database: iqvoc_skosxl_test
10
+ database: iqvoc_compound_forms_test
11
11
  username: root
12
12
  password:
13
13
  encoding: utf8
14
14
 
15
15
  production:
16
16
  adapter: mysql2
17
- database: iqvoc_skosxl_production
17
+ database: iqvoc_compound_forms_production
18
18
  username: root
19
19
  password:
20
20
  encoding: utf8
@@ -7,7 +7,7 @@ module Iqvoc
7
7
  paths["lib/tasks"] << "lib/engine_tasks"
8
8
 
9
9
  initializer "iqvoc_compound_forms.load_migrations" do |app|
10
- app.config.paths['db/migrate'] += Iqvoc::CompoundForms::Engine.paths['db/migrate'].existent
10
+ app.config.paths['db/migrate'].concat(Iqvoc::CompoundForms::Engine.paths['db/migrate'].existent)
11
11
  end
12
12
  end
13
13
 
@@ -1,4 +1,3 @@
1
- require 'debug'
2
1
  require 'iqvoc/environments/development'
3
2
 
4
3
  if Iqvoc::CompoundForms.const_defined?(:Application)
@@ -1,4 +1,3 @@
1
- require 'debug'
2
1
  require 'iqvoc/environments/test'
3
2
 
4
3
  if Iqvoc::CompoundForms.const_defined?(:Application)
@@ -1,6 +1,8 @@
1
1
  # initializer for both iqvoc and iqvoc_skosxl
2
2
 
3
- require 'iqvoc/xllabel' # XXX: this basically duplicates iqvoc_skosxl's initializer - but is required to ensure correct loading order!?
3
+ # This basically duplicates iqvoc_skosxl's initializer but is required to
4
+ # ensure correct loading order!?
5
+ require 'iqvoc/xllabel'
4
6
 
5
7
  Iqvoc.config.register_setting("title", "iQvoc Compound Forms")
6
8
 
@@ -9,3 +11,7 @@ Iqvoc::XLLabel.additional_association_class_names.
9
11
  "CompoundForm::Content::Base" => "label_id") # used for the reverse direction ("compound_in")
10
12
 
11
13
  Iqvoc::XLLabel.view_sections += ["compound_forms"]
14
+
15
+ ActiveSupport.on_load :skos_importer do
16
+ Iqvoc::SkosImporter.second_level_object_classes.delete(CompoundForm::Content::Base)
17
+ end
@@ -0,0 +1,11 @@
1
+ development:
2
+ secret_key_base: development
3
+
4
+ test:
5
+ secret_key_base: test
6
+
7
+ production:
8
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
9
+
10
+ heroku:
11
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -15,11 +15,10 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.rubyforge_project = "iqvoc_compound_forms"
17
17
 
18
- s.add_dependency "iqvoc", "~> 4.1.0"
19
- s.add_dependency "iqvoc_skosxl", "~> 2.1.0"
18
+ s.add_dependency "iqvoc", ">= 4.5.0", "~> 4.6"
19
+ s.add_dependency "iqvoc_skosxl", "~> 2.5.0"
20
20
 
21
21
  s.files = `git ls-files`.split("\n")
22
22
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
23
- s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
24
23
  s.require_paths = ["lib"]
25
24
  end
@@ -10,16 +10,20 @@ module Iqvoc::CompoundForms::LabelExtensions
10
10
  # Compound forms
11
11
  # Only handle compound form creation if there are submitted widget values
12
12
  # Otherwise compound_forms would be destroyed on every save (e.g. in the branching process)!
13
- if inline_compound_form_origins.present?
14
- compound_forms.destroy_all
15
- inline_compound_form_origins.each do |origin_collection|
16
- compound_form_contents = []
17
- origin_collection.each_with_index do |origin, index|
18
- if label = Iqvoc::XLLabel.base_class.editor_selectable.by_origin(origin).last
19
- compound_form_contents << CompoundForm::Content::Base.new(:label => label, :order => index)
13
+ if inline_compound_form_origins.any?
14
+ transaction do
15
+ compound_forms.destroy_all
16
+ inline_compound_form_origins.each do |origin_collection|
17
+ compound_form_contents = []
18
+ origin_collection.each_with_index do |origin, index|
19
+ if label = Iqvoc::XLLabel.base_class.editor_selectable.by_origin(origin).last
20
+ compound_form_contents << CompoundForm::Content::Base.new(:label => label, :order => index)
21
+ end
22
+ end
23
+ if compound_form_contents.any?
24
+ compound_forms.create!(:compound_form_contents => compound_form_contents)
20
25
  end
21
26
  end
22
- compound_forms.create!(:compound_form_contents => compound_form_contents)
23
27
  end
24
28
  end
25
29
  end
@@ -50,7 +54,7 @@ module Iqvoc::CompoundForms::LabelExtensions
50
54
 
51
55
  def inline_compound_form_origins=(value_collection)
52
56
  # write to instance variable and write it on after_safe
53
- @inline_compound_form_origins = []
57
+ @inline_compound_form_origins ||= []
54
58
 
55
59
  value_collection.reject(&:blank?).each do |value|
56
60
  @inline_compound_form_origins << value.split(/\r\n|, */).map(&:strip). # XXX: use Iqvoc::InlineDataHelper?
@@ -59,7 +63,7 @@ module Iqvoc::CompoundForms::LabelExtensions
59
63
  end
60
64
 
61
65
  def compound_form_contents_size
62
- if @full_validation
66
+ if validatable_for_publishing?
63
67
  compound_forms.each do |cf|
64
68
  if cf.compound_form_contents.count < 2
65
69
  errors.add :base, I18n.t("txt.models.label.compound_form_contents_error")
@@ -1,5 +1,5 @@
1
1
  module Iqvoc
2
2
  module CompoundForms
3
- VERSION = "2.1.0"
3
+ VERSION = "2.5.0"
4
4
  end
5
5
  end
@@ -0,0 +1,20 @@
1
+ <http://hobbies.com/computer_programming> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2004/02/skos/core#Concept> .
2
+ <http://hobbies.com/computer_programming> <http://www.w3.org/2008/05/skos-xl#prefLabel> <http://hobbies.com/computer_programming-en> .
3
+ <http://hobbies.com/computer_programming-en> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2008/05/skos-xl#Label> .
4
+ <http://hobbies.com/computer_programming-en> <http://www.w3.org/2008/05/skos-xl#literalForm> "Computer programming"@en .
5
+ <http://hobbies.com/computer-en> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2008/05/skos-xl#Label> .
6
+ <http://hobbies.com/computer-en> <http://www.w3.org/2008/05/skos-xl#literalForm> "Computer"@en .
7
+ <http://hobbies.com/programming-en> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2008/05/skos-xl#Label> .
8
+ <http://hobbies.com/programming-en> <http://www.w3.org/2008/05/skos-xl#literalForm> "Programming"@en .
9
+ <http://hobbies.com/cool-en> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2008/05/skos-xl#Label> .
10
+ <http://hobbies.com/cool-en> <http://www.w3.org/2008/05/skos-xl#literalForm> "Cool"@en .
11
+ <http://hobbies.com/computer_programming-en> <http://try.iqvoc.net/schema#compoundFrom> _:b3 .
12
+ _:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#List> .
13
+ _:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://hobbies.com/computer-en> .
14
+ _:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b4 .
15
+ _:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#List> .
16
+ _:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://hobbies.com/programming-en> .
17
+ _:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b5 .
18
+ _:b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#List> .
19
+ _:b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://hobbies.com/cool-en> .
20
+ _:b5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
@@ -1,5 +1,19 @@
1
1
  # encoding: UTF-8
2
2
 
3
+ # Copyright 2011-2014 innoQ Deutschland GmbH
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
3
17
  require File.join(File.expand_path(File.dirname(__FILE__)), '../test_helper')
4
18
 
5
19
  class CompoundFormTest < ActiveSupport::TestCase
@@ -0,0 +1,73 @@
1
+ # encoding: UTF-8
2
+
3
+ # Copyright 2011-2014 innoQ Deutschland GmbH
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require File.expand_path('../../test_helper', __FILE__)
18
+ require 'iqvoc/skos_importer'
19
+
20
+ class SkosImporterTest < ActiveSupport::TestCase
21
+
22
+ test 'compound forms import' do
23
+ test_data = File.open(File.expand_path('../../fixtures/hobbies.nt', __FILE__))
24
+ @importer = Iqvoc::SkosImporter.new(test_data, 'http://hobbies.com/')
25
+
26
+ assert_equal 0, CompoundForm::Base.count
27
+ assert_equal 0, CompoundForm::Content::Base.count
28
+
29
+ @importer.run
30
+
31
+ assert_equal 1, CompoundForm::Base.count
32
+ assert_equal 3, CompoundForm::Content::Base.count
33
+
34
+ compound_form = CompoundForm::Base.first
35
+ assert_equal 'computer_programming-en', compound_form.domain.origin
36
+ assert_equal 3, compound_form.compound_form_contents.size
37
+
38
+ cfc1, cfc2, cfc3 = *compound_form.compound_form_contents
39
+ assert_equal 'computer-en', cfc1.label.origin
40
+ assert_equal 'programming-en', cfc2.label.origin
41
+ assert_equal 'cool-en', cfc3.label.origin
42
+ end
43
+
44
+ test 'invalid compound forms import ' do
45
+ test_data = (<<-DATA
46
+ <http://hobbies.com/computer_programming> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2004/02/skos/core#Concept> .
47
+ <http://hobbies.com/computer_programming> <http://www.w3.org/2008/05/skos-xl#prefLabel> <http://hobbies.com/computer_programming-en> .
48
+ <http://hobbies.com/computer_programming-en> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2008/05/skos-xl#Label> .
49
+ <http://hobbies.com/computer_programming-en> <http://www.w3.org/2008/05/skos-xl#literalForm> "Computer programming"@en .
50
+ <http://hobbies.com/computer-en> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2008/05/skos-xl#Label> .
51
+ <http://hobbies.com/computer-en> <http://www.w3.org/2008/05/skos-xl#literalForm> "Computer"@en .
52
+ <http://hobbies.com/programming-en> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2008/05/skos-xl#Label> .
53
+ <http://hobbies.com/programming-en> <http://www.w3.org/2008/05/skos-xl#literalForm> "Programming"@en .
54
+ <http://hobbies.com/computer_programming-en> <http://try.iqvoc.net/schema#compoundFrom> _:b3 .
55
+ _:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#List> .
56
+ _:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://hobbies.com/computer-en> .
57
+ _:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b4 .
58
+ _:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#List> .
59
+ _:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <http://hobbies.com/programmig3rw8uoosgriohgrhoigrwhiogrwohiwgrouhgwrouhgwohuwrgohuwgrohiwgorihhoiwgrdhkjbnng-en> .
60
+ _:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
61
+ DATA
62
+ ).split("\n")
63
+
64
+ @importer = Iqvoc::SkosImporter.new(test_data, 'http://hobbies.com/')
65
+ assert_equal 0, CompoundForm::Base.count
66
+ assert_equal 0, CompoundForm::Content::Base.count
67
+
68
+ @importer.run
69
+
70
+ assert_equal 0, CompoundForm::Base.count
71
+ assert_equal 0, CompoundForm::Content::Base.count
72
+ end
73
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iqvoc_compound_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Glaser
@@ -10,36 +10,42 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-17 00:00:00.000000000 Z
13
+ date: 2014-10-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: iqvoc
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ~>
19
+ - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: 4.1.0
21
+ version: 4.5.0
22
+ - - "~>"
23
+ - !ruby/object:Gem::Version
24
+ version: '4.6'
22
25
  type: :runtime
23
26
  prerelease: false
24
27
  version_requirements: !ruby/object:Gem::Requirement
25
28
  requirements:
26
- - - ~>
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 4.5.0
32
+ - - "~>"
27
33
  - !ruby/object:Gem::Version
28
- version: 4.1.0
34
+ version: '4.6'
29
35
  - !ruby/object:Gem::Dependency
30
36
  name: iqvoc_skosxl
31
37
  requirement: !ruby/object:Gem::Requirement
32
38
  requirements:
33
- - - ~>
39
+ - - "~>"
34
40
  - !ruby/object:Gem::Version
35
- version: 2.1.0
41
+ version: 2.5.0
36
42
  type: :runtime
37
43
  prerelease: false
38
44
  version_requirements: !ruby/object:Gem::Requirement
39
45
  requirements:
40
- - - ~>
46
+ - - "~>"
41
47
  - !ruby/object:Gem::Version
42
- version: 2.1.0
48
+ version: 2.5.0
43
49
  description: ''
44
50
  email:
45
51
  - robert.glaser@innoq.com
@@ -47,8 +53,8 @@ executables: []
47
53
  extensions: []
48
54
  extra_rdoc_files: []
49
55
  files:
50
- - .gitignore
51
- - .travis.yml
56
+ - ".gitignore"
57
+ - ".travis.yml"
52
58
  - Gemfile
53
59
  - Gemfile.lock
54
60
  - README.md
@@ -62,6 +68,9 @@ files:
62
68
  - app/views/partials/compound_form/_compound_form.html.erb
63
69
  - app/views/partials/compound_form/_edit_base.html.erb
64
70
  - app/views/partials/compound_form/content/_base.html.erb
71
+ - bin/rails
72
+ - bin/rake
73
+ - bin/spring
65
74
  - config.ru
66
75
  - config/application.rb
67
76
  - config/boot.rb
@@ -75,15 +84,14 @@ files:
75
84
  - config/environments/test.rb
76
85
  - config/initializers/engine_extensions.rb
77
86
  - config/initializers/iqvoc.rb
78
- - config/initializers/secret_token.rb.template
79
87
  - config/initializers/session_store.rb
80
88
  - config/locales/activerecord.de.yml
81
89
  - config/locales/activerecord.en.yml
82
90
  - config/locales/de.yml
83
91
  - config/locales/en.yml
84
92
  - config/routes.rb
93
+ - config/secrets.yml
85
94
  - db/migrate/20120112100000_create_compound_forms.rb
86
- - db/schema.rb
87
95
  - db/seeds.rb
88
96
  - iqvoc_compound_forms.gemspec
89
97
  - lib/engine_tasks/db.rake
@@ -91,10 +99,11 @@ files:
91
99
  - lib/iqvoc/compound_forms/version.rb
92
100
  - lib/iqvoc_compound_forms.rb
93
101
  - public/.gitkeep
94
- - script/ci/travis_before_build.rb
95
102
  - script/rails
103
+ - test/fixtures/hobbies.nt
104
+ - test/models/compound_form_test.rb
105
+ - test/models/import_test.rb
96
106
  - test/test_helper.rb
97
- - test/unit/compound_form_test.rb
98
107
  homepage: ''
99
108
  licenses: []
100
109
  metadata: {}
@@ -104,20 +113,22 @@ require_paths:
104
113
  - lib
105
114
  required_ruby_version: !ruby/object:Gem::Requirement
106
115
  requirements:
107
- - - '>='
116
+ - - ">="
108
117
  - !ruby/object:Gem::Version
109
118
  version: '0'
110
119
  required_rubygems_version: !ruby/object:Gem::Requirement
111
120
  requirements:
112
- - - '>='
121
+ - - ">="
113
122
  - !ruby/object:Gem::Version
114
123
  version: '0'
115
124
  requirements: []
116
125
  rubyforge_project: iqvoc_compound_forms
117
- rubygems_version: 2.0.0
126
+ rubygems_version: 2.4.2
118
127
  signing_key:
119
128
  specification_version: 4
120
129
  summary: ''
121
130
  test_files:
131
+ - test/fixtures/hobbies.nt
132
+ - test/models/compound_form_test.rb
133
+ - test/models/import_test.rb
122
134
  - test/test_helper.rb
123
- - test/unit/compound_form_test.rb
@@ -1,16 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- # Be sure to restart your server when you modify this file.
4
-
5
- if Iqvoc::CompoundForms.const_defined?(:Application)
6
-
7
- # Your secret key for verifying the integrity of signed cookies.
8
- # If you change this key, all old signed cookies will become invalid!
9
- # Make sure the secret is at least 30 characters and all random,
10
- # no regular words or you'll be exposed to dictionary attacks.
11
-
12
- # Run `rake secret` and uncomment the following line
13
- # Replace the secret-placeholder with your generated token
14
- Iqvoc::CompoundForms::Application.config.secret_token = "S-E-C-R-E-T"
15
-
16
- end
@@ -1,166 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended to check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(:version => 20120112100000) do
15
-
16
- create_table "collection_members", :force => true do |t|
17
- t.integer "collection_id"
18
- t.integer "target_id"
19
- t.string "type"
20
- end
21
-
22
- add_index "collection_members", ["collection_id", "target_id", "type"], :name => "ix_collections_fk_type"
23
-
24
- create_table "compound_form_contents", :force => true do |t|
25
- t.datetime "created_at"
26
- t.datetime "updated_at"
27
- t.integer "compound_form_id"
28
- t.integer "label_id"
29
- t.integer "order"
30
- end
31
-
32
- add_index "compound_form_contents", ["compound_form_id"], :name => "ix_cfc_compound_form_id"
33
- add_index "compound_form_contents", ["label_id"], :name => "ix_cfc_label_id"
34
-
35
- create_table "compound_forms", :force => true do |t|
36
- t.datetime "created_at"
37
- t.datetime "updated_at"
38
- t.integer "domain_id"
39
- end
40
-
41
- add_index "compound_forms", ["domain_id"], :name => "ix_cf_fk"
42
-
43
- create_table "concept_relations", :force => true do |t|
44
- t.string "type"
45
- t.integer "owner_id"
46
- t.integer "target_id"
47
- t.datetime "created_at"
48
- t.datetime "updated_at"
49
- end
50
-
51
- add_index "concept_relations", ["owner_id", "target_id"], :name => "ix_concept_relations_fk"
52
-
53
- create_table "concepts", :force => true do |t|
54
- t.string "type"
55
- t.string "origin", :limit => 4000
56
- t.integer "rev", :default => 1
57
- t.date "published_at"
58
- t.integer "published_version_id"
59
- t.integer "locked_by"
60
- t.date "expired_at"
61
- t.date "follow_up"
62
- t.boolean "to_review"
63
- t.date "rdf_updated_at"
64
- t.datetime "created_at"
65
- t.datetime "updated_at"
66
- end
67
-
68
- add_index "concepts", ["origin"], :name => "ix_concepts_on_origin"
69
- add_index "concepts", ["published_version_id"], :name => "ix_concepts_publ_version_id"
70
-
71
- create_table "label_relations", :force => true do |t|
72
- t.string "type"
73
- t.integer "domain_id"
74
- t.integer "range_id"
75
- t.datetime "created_at"
76
- t.datetime "updated_at"
77
- end
78
-
79
- add_index "label_relations", ["domain_id", "range_id", "type"], :name => "ix_label_rel_dom_rng_type"
80
- add_index "label_relations", ["type"], :name => "ix_label_relations_on_type"
81
-
82
- create_table "labelings", :force => true do |t|
83
- t.string "type"
84
- t.integer "owner_id"
85
- t.integer "target_id"
86
- t.datetime "created_at"
87
- t.datetime "updated_at"
88
- end
89
-
90
- add_index "labelings", ["owner_id", "target_id", "type"], :name => "ix_labelings_fk_type"
91
- add_index "labelings", ["type"], :name => "ix_labelings_on_type"
92
-
93
- create_table "labels", :force => true do |t|
94
- t.string "type"
95
- t.string "origin", :limit => 4000
96
- t.string "language"
97
- t.string "value", :limit => 1024
98
- t.datetime "created_at"
99
- t.datetime "updated_at"
100
- t.integer "rev", :default => 1
101
- t.integer "published_version_id"
102
- t.date "published_at"
103
- t.integer "locked_by"
104
- t.date "expired_at"
105
- t.date "follow_up"
106
- t.boolean "to_review"
107
- t.date "rdf_updated_at"
108
- end
109
-
110
- add_index "labels", ["language"], :name => "ix_labels_on_language"
111
- add_index "labels", ["origin"], :name => "ix_labels_on_origin"
112
- add_index "labels", ["published_version_id"], :name => "ix_labels_on_published_v"
113
- add_index "labels", ["value"], :name => "ix_labels_on_value"
114
-
115
- create_table "matches", :force => true do |t|
116
- t.integer "concept_id"
117
- t.string "type"
118
- t.string "value"
119
- t.datetime "created_at"
120
- t.datetime "updated_at"
121
- end
122
-
123
- add_index "matches", ["concept_id", "type"], :name => "ix_matches_fk_type"
124
- add_index "matches", ["type"], :name => "ix_matches_on_type"
125
-
126
- create_table "note_annotations", :force => true do |t|
127
- t.integer "note_id"
128
- t.string "predicate", :limit => 50
129
- t.string "value", :limit => 1024
130
- t.datetime "created_at"
131
- t.datetime "updated_at"
132
- t.string "namespace", :limit => 50
133
- end
134
-
135
- add_index "note_annotations", ["note_id"], :name => "ix_note_annotations_fk"
136
-
137
- create_table "notes", :force => true do |t|
138
- t.string "language", :limit => 2
139
- t.string "value", :limit => 4000
140
- t.string "type", :limit => 50
141
- t.datetime "created_at"
142
- t.datetime "updated_at"
143
- t.integer "owner_id"
144
- t.string "owner_type", :null => false
145
- end
146
-
147
- add_index "notes", ["language"], :name => "ix_notes_on_language"
148
- add_index "notes", ["owner_id", "owner_type", "type"], :name => "ix_notes_fk_type"
149
- add_index "notes", ["type"], :name => "ix_notes_on_type"
150
-
151
- create_table "users", :force => true do |t|
152
- t.string "forename"
153
- t.string "surname"
154
- t.string "email"
155
- t.string "crypted_password"
156
- t.boolean "active"
157
- t.datetime "created_at"
158
- t.datetime "updated_at"
159
- t.string "password_salt"
160
- t.string "persistence_token"
161
- t.string "perishable_token"
162
- t.string "role"
163
- t.string "telephone_number"
164
- end
165
-
166
- end
@@ -1 +0,0 @@
1
- system "cp config/database.#{ENV['DB']}.yml config/database.yml"