iqvoc_skosxl 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gem 'rails', '3.2.1'
4
- gem 'iqvoc', '~> 3.5.1' #, :path => '../iqvoc'
4
+ gem 'iqvoc', '~> 3.5.5'
5
5
 
6
6
  group :development do
7
7
  gem 'awesome_print'
@@ -17,7 +17,7 @@ group :development, :test do
17
17
  gem 'sqlite3'
18
18
  end
19
19
  platforms :jruby do
20
- gem 'activerecord-jdbcsqlite-adapter'
20
+ gem 'activerecord-jdbcsqlite3-adapter'
21
21
  gem 'activerecord-jdbcmysql-adapter'
22
22
  end
23
23
  end
data/Gemfile.lock CHANGED
@@ -22,6 +22,14 @@ GEM
22
22
  activesupport (= 3.2.1)
23
23
  arel (~> 3.0.0)
24
24
  tzinfo (~> 0.3.29)
25
+ activerecord-jdbc-adapter (1.2.2)
26
+ activerecord-jdbcmysql-adapter (1.2.2)
27
+ activerecord-jdbc-adapter (~> 1.2.2)
28
+ jdbc-mysql (~> 5.1.0)
29
+ activerecord-jdbcsqlite3-adapter (1.2.2)
30
+ activerecord-jdbc-adapter (~> 1.2.2)
31
+ jdbc-sqlite3 (~> 3.7.2)
32
+ activerecord-oracle_enhanced-adapter (1.4.1)
25
33
  activeresource (3.2.1)
26
34
  activemodel (= 3.2.1)
27
35
  activesupport (= 3.2.1)
@@ -53,23 +61,29 @@ GEM
53
61
  factory_girl_rails (1.6.0)
54
62
  factory_girl (~> 2.5.0)
55
63
  railties (>= 3.0.0)
64
+ fastercsv (1.5.4)
56
65
  ffi (1.0.11)
66
+ ffi (1.0.11-java)
57
67
  hike (1.2.1)
58
68
  i18n (0.6.0)
59
69
  iq_rdf (0.1.2)
60
70
  builder
61
71
  bundler
62
- iqvoc (3.5.1)
72
+ iqvoc (3.5.5)
63
73
  authlogic
64
74
  bundler
65
75
  cancan
76
+ fastercsv
66
77
  iq_rdf (~> 0.1.2)
67
78
  json
68
79
  kaminari
69
80
  rails (~> 3.2.1)
70
81
  rails_autolink
82
+ jdbc-mysql (5.1.13)
83
+ jdbc-sqlite3 (3.7.2)
71
84
  journey (1.0.1)
72
85
  json (1.6.5)
86
+ json (1.6.5-java)
73
87
  kaminari (0.13.0)
74
88
  actionpack (>= 3.0.0)
75
89
  activesupport (>= 3.0.0)
@@ -82,6 +96,7 @@ GEM
82
96
  multi_json (1.0.4)
83
97
  mysql2 (0.3.11)
84
98
  nokogiri (1.5.0)
99
+ nokogiri (1.5.0-java)
85
100
  polyglot (0.3.3)
86
101
  rack (1.4.1)
87
102
  rack-cache (1.1)
@@ -134,17 +149,18 @@ GEM
134
149
  nokogiri (~> 1.3)
135
150
 
136
151
  PLATFORMS
152
+ java
137
153
  ruby
138
154
 
139
155
  DEPENDENCIES
140
156
  activerecord-jdbcmysql-adapter
141
- activerecord-jdbcsqlite-adapter
157
+ activerecord-jdbcsqlite3-adapter
142
158
  activerecord-oracle_enhanced-adapter
143
159
  awesome_print
144
160
  capybara
145
161
  database_cleaner
146
162
  factory_girl_rails
147
- iqvoc (~> 3.5.1)
163
+ iqvoc (~> 3.5.5)
148
164
  mysql2
149
165
  nokogiri (~> 1.5.0)
150
166
  rails (= 3.2.1)
@@ -24,23 +24,7 @@ module Concept
24
24
  end
25
25
  end
26
26
  end
27
-
28
- end
29
-
30
- def valid_label_language
31
- (@labelings_by_id || {}).each { |labeling_class_name, origin_mappings|
32
- origin_mappings.each { |language, new_origins|
33
- new_origins = new_origins.split(Iqvoc::InlineDataHelper::Splitter)
34
- Iqvoc::XLLabel.base_class.by_origin(new_origins).each do |label|
35
- if label.language != language.to_s
36
- errors.add(:base,
37
- I18n.t("txt.controllers.versioned_concept.label_error") % label)
38
- end
39
- end
40
- }
41
- }
42
27
  end
43
-
44
28
  end
45
29
 
46
30
  def labelings_by_id=(hash)
@@ -52,6 +36,20 @@ module Concept
52
36
  self.send(relation_name).by_label_language(language).
53
37
  map { |l| l.target.origin }.join(Iqvoc::InlineDataHelper::Joiner)
54
38
  end
39
+
40
+ def valid_label_language
41
+ (@labelings_by_id || {}).each { |labeling_class_name, origin_mappings|
42
+ origin_mappings.each { |language, new_origins|
43
+ new_origins = new_origins.split(Iqvoc::InlineDataHelper::Splitter)
44
+ Iqvoc::XLLabel.base_class.by_origin(new_origins).each do |label|
45
+ if label.language != language.to_s
46
+ errors.add(:base,
47
+ I18n.t("txt.controllers.versioned_concept.label_error") % label)
48
+ end
49
+ end
50
+ }
51
+ }
52
+ end
55
53
 
56
54
  end
57
55
  end
@@ -9,27 +9,28 @@ class Label::Relation::Base < ActiveRecord::Base
9
9
  belongs_to :domain, :class_name => "Label::Base"
10
10
  belongs_to :range, :class_name => "Label::Base"
11
11
 
12
- scope :by_domain, lambda { |domain|
12
+ def self.by_domain(domain)
13
13
  where(:domain_id => domain)
14
- }
15
-
16
- scope :by_range, lambda { |range|
14
+ end
15
+
16
+ def self.by_range(range)
17
17
  where(:range_id => range)
18
- }
19
-
20
- scope :by_range_origin, lambda { |origin|
18
+ end
19
+
20
+ def self.by_range_origin(origin)
21
21
  includes(:range).merge(Label::Base.by_origin(origin))
22
- }
23
-
24
- scope :range_editor_selectable, lambda {
25
- # includes(:range) & Iqvoc::XLLabel.base_class.editor_selectable # Doesn't work correctly (kills label_relations.type condition :-( )
26
- includes(:range).where("labels.published_at IS NOT NULL OR (labels.published_at IS NULL AND labels.published_version_id IS NULL) ")
27
- }
22
+ end
23
+
24
+ def self.range_editor_selectable
25
+ # includes(:range) & Iqvoc::XLLabel.base_class.editor_selectable
26
+ # Doesn't work correctly (kills label_relations.type condition :-( )
27
+ includes(:range).
28
+ where("labels.published_at IS NOT NULL OR (labels.published_at IS NULL AND labels.published_version_id IS NULL) ")
29
+ end
28
30
 
29
- scope :range_in_edit_mode, lambda {
31
+ def self.range_in_edit_mode
30
32
  joins(:range).merge(Iqvoc::XLLabel.base_class.in_edit_mode)
31
- }
32
-
33
+ end
33
34
 
34
35
  def self.view_section(obj)
35
36
  "relations"
@@ -89,16 +89,17 @@ class Label::SKOSXL::Base < Label::Base
89
89
 
90
90
  # ********** Scopes
91
91
 
92
- scope :by_origin, lambda { |origin|
92
+ def self.by_origin(origin)
93
93
  where(:origin => origin)
94
- }
95
-
96
- scope :with_associations, lambda { includes(:labelings => :owner) }
94
+ end
97
95
 
98
- scope :for_dashboard, lambda {
99
- unpublished_or_follow_up.
100
- includes(:locking_user)
101
- }
96
+ def self.with_associations
97
+ includes(:labelings => :owner)
98
+ end
99
+
100
+ def self.for_dashboard
101
+ unpublished_or_follow_up.includes(:locking_user)
102
+ end
102
103
 
103
104
  # ********** Methods
104
105
 
@@ -1,20 +1,20 @@
1
1
  class Labeling::SKOSXL::Base < Labeling::Base
2
2
 
3
- scope :target_in_edit_mode, lambda {
3
+ def self.target_in_edit_mode
4
4
  includes(:target).merge(Iqvoc::XLLabel.base_class.in_edit_mode)
5
- }
5
+ end
6
6
 
7
- scope :by_label_origin, lambda { |origin|
7
+ def self.by_label_origin(origin)
8
8
  includes(:target).merge(self.label_class.by_origin(origin))
9
- }
10
-
11
- scope :by_label_language, lambda { |language|
9
+ end
10
+
11
+ def self.by_label_language(language)
12
12
  includes(:target).merge(self.label_class.by_language(language))
13
- }
14
-
15
- scope :label_editor_selectable, lambda { # Lambda because self.label_class is currently not known + we don't want to call it at load time!
13
+ end
14
+
15
+ def self.label_editor_selectable
16
16
  includes(:target).merge(self.label_class.editor_selectable)
17
- }
17
+ end
18
18
 
19
19
  def self.create_for(o, t)
20
20
  find_or_create_by_owner_id_and_target_id(o.id, t.id)
@@ -66,6 +66,10 @@ class Labeling::SKOSXL::Base < Labeling::Base
66
66
  def self.edit_partial_name(obj)
67
67
  "partials/labeling/skosxl/edit_base"
68
68
  end
69
+
70
+ # def by_label_language(language)
71
+ # includes(:target).merge(self.label_class.by_language(language))
72
+ # end
69
73
 
70
74
  def build_search_result_rdf(document, result)
71
75
  result.Sdc::link(IqRdf.build_uri(owner.origin))
@@ -1,4 +1,4 @@
1
- de:
1
+ en:
2
2
  activerecord:
3
3
  models:
4
4
  label/skosxl/base:
data/db/schema.rb CHANGED
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20120119000000) do
14
+ ActiveRecord::Schema.define(:version => 20120201120736) do
15
15
 
16
16
  create_table "collection_members", :force => true do |t|
17
17
  t.integer "collection_id"
@@ -44,6 +44,7 @@ ActiveRecord::Schema.define(:version => 20120119000000) do
44
44
  t.date "rdf_updated_at"
45
45
  t.datetime "created_at"
46
46
  t.datetime "updated_at"
47
+ t.boolean "top_term", :default => false
47
48
  end
48
49
 
49
50
  add_index "concepts", ["origin"], :name => "ix_concepts_on_origin", :length => {"origin"=>255}
@@ -1,5 +1,5 @@
1
1
  module Iqvoc
2
2
  module SKOSXL
3
- VERSION = "1.2.0"
3
+ VERSION = "1.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iqvoc_skosxl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-02-01 00:00:00.000000000 Z
14
+ date: 2012-02-21 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: iqvoc
18
- requirement: &70319992012880 !ruby/object:Gem::Requirement
18
+ requirement: &70305772581040 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 3.5.1
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70319992012880
26
+ version_requirements: *70305772581040
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
- requirement: &70319992012460 !ruby/object:Gem::Requirement
29
+ requirement: &70305772580620 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,7 +34,7 @@ dependencies:
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70319992012460
37
+ version_requirements: *70305772580620
38
38
  description: ''
39
39
  email:
40
40
  - till.schulte-coerne@innoq.com
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 1.8.10
143
+ rubygems_version: 1.8.15
144
144
  signing_key:
145
145
  specification_version: 3
146
146
  summary: iQvoc SKOS-XL extension