tr8n 3.2.1 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.rdoc +19 -13
- data/app/controllers/tr8n/base_controller.rb +5 -1
- data/app/controllers/tr8n/language_controller.rb +2 -2
- data/app/models/tr8n/base_filter.rb +21 -0
- data/app/models/tr8n/daily_language_metric.rb +46 -22
- data/app/models/tr8n/date_rule.rb +41 -22
- data/app/models/tr8n/gender_list_rule.rb +41 -22
- data/app/models/tr8n/gender_rule.rb +41 -22
- data/app/models/tr8n/glossary.rb +44 -27
- data/app/models/tr8n/glossary_filter.rb +56 -33
- data/app/models/tr8n/ip_location.rb +23 -0
- data/app/models/tr8n/ip_location_filter.rb +57 -34
- data/app/models/tr8n/language.rb +28 -0
- data/app/models/tr8n/language_case.rb +27 -0
- data/app/models/tr8n/language_case_filter.rb +53 -30
- data/app/models/tr8n/language_case_rule.rb +24 -0
- data/app/models/tr8n/language_case_rule_filter.rb +53 -30
- data/app/models/tr8n/language_case_value_map.rb +24 -0
- data/app/models/tr8n/language_case_value_map_filter.rb +68 -45
- data/app/models/tr8n/language_filter.rb +23 -0
- data/app/models/tr8n/language_forum_abuse_report.rb +56 -33
- data/app/models/tr8n/language_forum_abuse_report_filter.rb +57 -34
- data/app/models/tr8n/language_forum_message.rb +69 -46
- data/app/models/tr8n/language_forum_message_filter.rb +61 -38
- data/app/models/tr8n/language_forum_topic.rb +62 -41
- data/app/models/tr8n/language_forum_topic_filter.rb +61 -38
- data/app/models/tr8n/language_metric.rb +28 -1
- data/app/models/tr8n/language_metric_filter.rb +23 -0
- data/app/models/tr8n/language_rule.rb +23 -0
- data/app/models/tr8n/language_rule_filter.rb +72 -49
- data/app/models/tr8n/language_user.rb +86 -61
- data/app/models/tr8n/language_user_filter.rb +57 -34
- data/app/models/tr8n/list_rule.rb +41 -22
- data/app/models/tr8n/monthly_language_metric.rb +46 -22
- data/app/models/tr8n/numeric_rule.rb +41 -22
- data/app/models/tr8n/sync_log.rb +21 -0
- data/app/models/tr8n/sync_log_filter.rb +48 -27
- data/app/models/tr8n/total_language_metric.rb +46 -22
- data/app/models/tr8n/translation.rb +28 -0
- data/app/models/tr8n/translation_domain.rb +76 -56
- data/app/models/tr8n/translation_domain_filter.rb +49 -26
- data/app/models/tr8n/translation_filter.rb +57 -34
- data/app/models/tr8n/translation_key.rb +44 -8
- data/app/models/tr8n/translation_key_comment.rb +60 -37
- data/app/models/tr8n/translation_key_comment_filter.rb +53 -30
- data/app/models/tr8n/translation_key_filter.rb +68 -45
- data/app/models/tr8n/translation_key_lock.rb +81 -59
- data/app/models/tr8n/translation_key_lock_filter.rb +53 -30
- data/app/models/tr8n/translation_key_source.rb +22 -0
- data/app/models/tr8n/translation_key_source_filter.rb +53 -30
- data/app/models/tr8n/translation_source.rb +20 -0
- data/app/models/tr8n/translation_source_filter.rb +53 -30
- data/app/models/tr8n/translation_source_language.rb +58 -39
- data/app/models/tr8n/translation_vote.rb +56 -35
- data/app/models/tr8n/translation_vote_filter.rb +57 -34
- data/app/models/tr8n/translator.rb +38 -0
- data/app/models/tr8n/translator_filter.rb +73 -50
- data/app/models/tr8n/translator_following.rb +58 -38
- data/app/models/tr8n/translator_following_filter.rb +57 -34
- data/app/models/tr8n/translator_log.rb +25 -0
- data/app/models/tr8n/translator_log_filter.rb +72 -49
- data/app/models/tr8n/translator_metric.rb +27 -0
- data/app/models/tr8n/translator_metric_filter.rb +61 -38
- data/app/models/tr8n/translator_report.rb +23 -0
- data/app/models/tr8n/translator_report_filter.rb +53 -30
- data/app/models/tr8n/value_rule.rb +41 -22
- data/bin/{tr8n.rb → tr8n} +0 -0
- data/file +94 -0
- data/lib/tasks/dev.rake +162 -0
- data/lib/tr8n/config.rb +5 -1
- data/lib/tr8n/version.rb +1 -1
- data/local/tr8n_server/config/tr8n/config.yml +2 -1
- data/local/tr8n_server/db/schema.rb +0 -2
- metadata +45 -43
@@ -1,28 +1,49 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 2010-2012 Michael Berkovich, tr8n.net
|
3
|
-
#
|
4
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
-
# a copy of this software and associated documentation files (the
|
6
|
-
# "Software"), to deal in the Software without restriction, including
|
7
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
-
# the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be
|
13
|
-
# included in all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
-
#++
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2010-2012 Michael Berkovich, tr8n.net
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
#
|
24
|
+
#-- Tr8n::SyncLogFilter Schema Information
|
25
|
+
#
|
26
|
+
# Table name: will_filter_filters
|
27
|
+
#
|
28
|
+
# id INTEGER not null, primary key
|
29
|
+
# type varchar(255)
|
30
|
+
# name varchar(255)
|
31
|
+
# data text
|
32
|
+
# user_id integer
|
33
|
+
# model_class_name varchar(255)
|
34
|
+
# created_at datetime
|
35
|
+
# updated_at datetime
|
36
|
+
#
|
37
|
+
# Indexes
|
38
|
+
#
|
39
|
+
# index_will_filter_filters_on_user_id (user_id)
|
40
|
+
#
|
41
|
+
#++
|
42
|
+
|
43
|
+
class Tr8n::SyncLogFilter < Tr8n::BaseFilter
|
44
|
+
|
45
|
+
def model_class
|
46
|
+
Tr8n::SyncLog
|
47
|
+
end
|
48
|
+
|
28
49
|
end
|
@@ -1,25 +1,49 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 2010-2012 Michael Berkovich, tr8n.net
|
3
|
-
#
|
4
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
-
# a copy of this software and associated documentation files (the
|
6
|
-
# "Software"), to deal in the Software without restriction, including
|
7
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
-
# the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be
|
13
|
-
# included in all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
-
#++
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2010-2012 Michael Berkovich, tr8n.net
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
#
|
24
|
+
#-- Tr8n::TotalLanguageMetric Schema Information
|
25
|
+
#
|
26
|
+
# Table name: tr8n_language_metrics
|
27
|
+
#
|
28
|
+
# id INTEGER not null, primary key
|
29
|
+
# type varchar(255)
|
30
|
+
# language_id integer not null
|
31
|
+
# metric_date date
|
32
|
+
# user_count integer default = 0
|
33
|
+
# translator_count integer default = 0
|
34
|
+
# translation_count integer default = 0
|
35
|
+
# key_count integer default = 0
|
36
|
+
# locked_key_count integer default = 0
|
37
|
+
# translated_key_count integer default = 0
|
38
|
+
# created_at datetime
|
39
|
+
# updated_at datetime
|
40
|
+
#
|
41
|
+
# Indexes
|
42
|
+
#
|
43
|
+
# index_tr8n_language_metrics_on_created_at (created_at)
|
44
|
+
# index_tr8n_language_metrics_on_language_id (language_id)
|
45
|
+
#
|
46
|
+
#++
|
23
47
|
|
24
48
|
class Tr8n::TotalLanguageMetric < Tr8n::LanguageMetric
|
25
49
|
|
@@ -20,9 +20,37 @@
|
|
20
20
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
22
|
#++
|
23
|
+
#
|
24
|
+
#-- Tr8n::Translation Schema Information
|
25
|
+
#
|
26
|
+
# Table name: tr8n_translations
|
27
|
+
#
|
28
|
+
# id INTEGER not null, primary key
|
29
|
+
# translation_key_id integer not null
|
30
|
+
# language_id integer not null
|
31
|
+
# translator_id integer not null
|
32
|
+
# label text not null
|
33
|
+
# rank integer default = 0
|
34
|
+
# approved_by_id integer(8)
|
35
|
+
# rules text
|
36
|
+
# created_at datetime
|
37
|
+
# updated_at datetime
|
38
|
+
# synced_at datetime
|
39
|
+
#
|
40
|
+
# Indexes
|
41
|
+
#
|
42
|
+
# tr8n_trans_created_at (created_at)
|
43
|
+
# tr8n_trans_key_id_translator_id_lang_id (translation_key_id, translator_id, language_id)
|
44
|
+
# r8n_trans_translator_id (translator_id)
|
45
|
+
#
|
46
|
+
#++
|
23
47
|
|
24
48
|
class Tr8n::Translation < ActiveRecord::Base
|
25
49
|
set_table_name :tr8n_translations
|
50
|
+
|
51
|
+
attr_accessible :translation_key_id, :language_id, :translator_id, :label, :rank, :approved_by_id, :rules, :synced_at
|
52
|
+
attr_accessible :language, :translator, :translation_key
|
53
|
+
|
26
54
|
after_save :update_cache
|
27
55
|
after_destroy :update_cache
|
28
56
|
|
@@ -1,56 +1,76 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 2010-2012 Michael Berkovich, tr8n.net
|
3
|
-
#
|
4
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
-
# a copy of this software and associated documentation files (the
|
6
|
-
# "Software"), to deal in the Software without restriction, including
|
7
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
-
# the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be
|
13
|
-
# included in all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
-
#++
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2010-2012 Michael Berkovich, tr8n.net
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
#
|
24
|
+
#-- Tr8n::TranslationDomain Schema Information
|
25
|
+
#
|
26
|
+
# Table name: tr8n_translation_domains
|
27
|
+
#
|
28
|
+
# id INTEGER not null, primary key
|
29
|
+
# name varchar(255)
|
30
|
+
# description varchar(255)
|
31
|
+
# source_count integer default = 0
|
32
|
+
# created_at datetime
|
33
|
+
# updated_at datetime
|
34
|
+
#
|
35
|
+
# Indexes
|
36
|
+
#
|
37
|
+
# index_tr8n_translation_domains_on_name (name) UNIQUE
|
38
|
+
#
|
39
|
+
#++
|
40
|
+
|
41
|
+
class Tr8n::TranslationDomain < ActiveRecord::Base
|
42
|
+
set_table_name :tr8n_translation_domains
|
43
|
+
|
44
|
+
attr_accessible :name, :description, :source_count
|
45
|
+
|
46
|
+
after_save :clear_cache
|
47
|
+
after_destroy :clear_cache
|
48
|
+
|
49
|
+
has_many :translation_sources, :class_name => "Tr8n::TranslationSource", :dependent => :destroy
|
50
|
+
has_many :translation_key_sources, :class_name => "Tr8n::TranslationKeySource", :through => :translation_sources
|
51
|
+
has_many :translation_keys, :class_name => "Tr8n::TranslationKey", :through => :translation_key_sources
|
52
|
+
|
53
|
+
alias :sources :translation_sources
|
54
|
+
alias :key_sources :translation_key_sources
|
55
|
+
alias :keys :translation_keys
|
56
|
+
|
57
|
+
def self.cache_key(domain_name)
|
58
|
+
"translation_domain_#{domain_name}"
|
59
|
+
end
|
60
|
+
|
61
|
+
def cache_key
|
62
|
+
self.class.cache_key(name)
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.find_or_create(url = nil)
|
66
|
+
domain_name = URI.parse(url || 'localhost').host || 'localhost'
|
67
|
+
Tr8n::Cache.fetch(cache_key(domain_name)) do
|
68
|
+
find_by_name(domain_name) || create(:name => domain_name)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def clear_cache
|
73
|
+
Tr8n::Cache.delete(cache_key)
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
@@ -1,26 +1,49 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 2010-2012 Michael Berkovich, tr8n.net
|
3
|
-
#
|
4
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
-
# a copy of this software and associated documentation files (the
|
6
|
-
# "Software"), to deal in the Software without restriction, including
|
7
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
-
# the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be
|
13
|
-
# included in all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
-
#++
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2010-2012 Michael Berkovich, tr8n.net
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
#
|
24
|
+
#-- Tr8n::TranslationDomainFilter Schema Information
|
25
|
+
#
|
26
|
+
# Table name: will_filter_filters
|
27
|
+
#
|
28
|
+
# id INTEGER not null, primary key
|
29
|
+
# type varchar(255)
|
30
|
+
# name varchar(255)
|
31
|
+
# data text
|
32
|
+
# user_id integer
|
33
|
+
# model_class_name varchar(255)
|
34
|
+
# created_at datetime
|
35
|
+
# updated_at datetime
|
36
|
+
#
|
37
|
+
# Indexes
|
38
|
+
#
|
39
|
+
# index_will_filter_filters_on_user_id (user_id)
|
40
|
+
#
|
41
|
+
#++
|
42
|
+
|
43
|
+
class Tr8n::TranslationDomainFilter < Tr8n::BaseFilter
|
44
|
+
|
45
|
+
def model_class
|
46
|
+
Tr8n::TranslationDomain
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
@@ -1,34 +1,57 @@
|
|
1
|
-
#--
|
2
|
-
# Copyright (c) 2010-2012 Michael Berkovich, tr8n.net
|
3
|
-
#
|
4
|
-
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
-
# a copy of this software and associated documentation files (the
|
6
|
-
# "Software"), to deal in the Software without restriction, including
|
7
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
-
# the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be
|
13
|
-
# included in all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
-
#++
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2010-2012 Michael Berkovich, tr8n.net
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
#
|
24
|
+
#-- Tr8n::TranslationFilter Schema Information
|
25
|
+
#
|
26
|
+
# Table name: will_filter_filters
|
27
|
+
#
|
28
|
+
# id INTEGER not null, primary key
|
29
|
+
# type varchar(255)
|
30
|
+
# name varchar(255)
|
31
|
+
# data text
|
32
|
+
# user_id integer
|
33
|
+
# model_class_name varchar(255)
|
34
|
+
# created_at datetime
|
35
|
+
# updated_at datetime
|
36
|
+
#
|
37
|
+
# Indexes
|
38
|
+
#
|
39
|
+
# index_will_filter_filters_on_user_id (user_id)
|
40
|
+
#
|
41
|
+
#++
|
42
|
+
|
43
|
+
class Tr8n::TranslationFilter < Tr8n::BaseFilter
|
44
|
+
|
45
|
+
def model_class
|
46
|
+
Tr8n::Translation
|
47
|
+
end
|
48
|
+
|
49
|
+
def default_filter_if_empty
|
50
|
+
"created_today"
|
51
|
+
end
|
52
|
+
|
53
|
+
def inner_joins
|
54
|
+
[:language, :translation_key]
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|