gettext_i18n_rails 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcf3c818398964ccf048dd0cc390f4bc35e7c1f0
|
4
|
+
data.tar.gz: f6f51f715264fcecb63132f1306c384e639597f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4940be85bf26b8bd835977b7f131f74fb15b6120556624aa9800cb5ed0fe11ac821629324f8cfde0b7bc3922e0875c57e9625d2dbab0bbf2c30cee9688c93b1
|
7
|
+
data.tar.gz: ddf419d60fee3164534353fae969b8d1a2e23826009abac95eab39a1f9e336f663eb5110e510859be56927c7c5026ee071b63ad0454dba6113f97bc809b25fbf
|
@@ -41,6 +41,10 @@ module GettextI18nRails
|
|
41
41
|
found
|
42
42
|
end
|
43
43
|
|
44
|
+
def initialize
|
45
|
+
@existing_tables = ActiveRecord::Base.connection.tables
|
46
|
+
end
|
47
|
+
|
44
48
|
# Rails < 3.0 doesn't have DescendantsTracker.
|
45
49
|
# Instead of iterating over ObjectSpace (slow) the decision was made NOT to support
|
46
50
|
# class hierarchies with abstract base classes in Rails 2.x
|
@@ -51,7 +55,7 @@ module GettextI18nRails
|
|
51
55
|
model.direct_descendants.reject {|m| ignored?(m.table_name, ignored_tables)}.inject([]) do |attrs, m|
|
52
56
|
attrs.push(model_attributes(m, ignored_tables, ignored_cols)).flatten.uniq
|
53
57
|
end
|
54
|
-
elsif !ignored?(model.table_name, ignored_tables)
|
58
|
+
elsif !ignored?(model.table_name, ignored_tables) && @existing_tables.include?(model.table_name)
|
55
59
|
model.columns.reject { |c| ignored?(c.name, ignored_cols) }.collect { |c| c.name }
|
56
60
|
else
|
57
61
|
[]
|
@@ -79,7 +79,7 @@ namespace :gettext do
|
|
79
79
|
require 'gettext_i18n_rails/model_attributes_finder'
|
80
80
|
require 'gettext_i18n_rails/active_record'
|
81
81
|
|
82
|
-
storage_file = "#{locale_path}
|
82
|
+
storage_file = "#{locale_path}/../model_attributes.rb"
|
83
83
|
puts "writing model translations to: #{storage_file}"
|
84
84
|
|
85
85
|
ignore_tables = [/^sitemap_/, /_versions$/, 'schema_migrations', 'sessions', 'delayed_jobs']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gettext_i18n_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fast_gettext
|