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: fcd2307257eb59c2a3d9e9d031f6ca4b76065586
4
- data.tar.gz: 26c3c23f672234372272fff58b1a9d8f397f1f64
3
+ metadata.gz: dcf3c818398964ccf048dd0cc390f4bc35e7c1f0
4
+ data.tar.gz: f6f51f715264fcecb63132f1306c384e639597f3
5
5
  SHA512:
6
- metadata.gz: 4fb47e5ec9074945e2ec89ae19f5c7b598e0edec672e18083d5466da3d0512bbcda4ba345af2c236edaf2ed09bef4230dcb5e86fef6947227c6942817a4caeab
7
- data.tar.gz: 38c2c7762d6d0047115ae01891b06717f50a9799a8948326643aa7bac47b6d0f7a79d6c558c62c1d8b0f2de861b05710e12f5e59e9f2876e349e5a70020d2f0e
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}/model_attributes.rb"
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']
@@ -1,3 +1,3 @@
1
1
  module GettextI18nRails
2
- Version = VERSION = '1.1.0'
2
+ Version = VERSION = '1.2.0'
3
3
  end
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.1.0
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: 2014-07-09 00:00:00.000000000 Z
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast_gettext