globalize-accessors 0.2.0 → 0.2.1

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: 3229262ee8f633268283f5d27f9530b3ee419d8f
4
- data.tar.gz: 791ffbdfa8071c57411f9e00f9366a3b242731d9
3
+ metadata.gz: dccc82e877027eeead3d16bd978f4572fc2b20a6
4
+ data.tar.gz: 01765a2648c21e12b7e8c7e797c307d93fc6a020
5
5
  SHA512:
6
- metadata.gz: 31cadd05e47d9c3b701527d4e70b551ad542a2594fa0f0c18c6064b9cb669bfc8c473568e286fb68a6784010d9f251f41fe93dbb4d3bd80cd80c44d1d0d9c92a
7
- data.tar.gz: da7ac8bb04ae0993b630203065750694abd8b372192d6ae706b2daf46b6deec78602443daa2c6ffd0c21c7a4e7d131b07ff6b9744148fd9dfea7e305207f0ed6
6
+ metadata.gz: e712daebd70c2fd8c6d6e4f21baa4fad507a22746282fb8182d72c7579ea33b1351bd77d1e97e969bc46a54f007f0903d36ced1aeebb0afcc9c1db23f192d347
7
+ data.tar.gz: 1b68538eac8757fd852dbbe764d9822d5da5469fcae1382c6bc41ecb12ca4677ea83cbaac558b1d19172de2e074463c30d547c96e58a957e24c6bd37ce87932b
@@ -1,10 +1,10 @@
1
1
  language: ruby
2
+ sudo: false
3
+ cache: bundler
2
4
  before_script:
3
5
  - "cp test/db/database.yml.travis test/db/database.yml"
4
6
  script: "bundle exec rake"
5
- env:
6
- - RAILS_3=true
7
- - RAILS_4=true
8
7
  rvm:
8
+ - 2.2
9
+ - 2.1
9
10
  - 2.0.0
10
- - 1.9.3
@@ -14,10 +14,10 @@ Gem::Specification.new do |s|
14
14
  s.required_rubygems_version = ">= 1.3"
15
15
  s.rubyforge_project = "globalize-accessors"
16
16
 
17
- s.add_dependency "globalize", "~> 5.0.0"
18
- s.add_development_dependency "bundler", "~> 1.7.2"
19
- s.add_development_dependency "rake", "~> 0.9.2"
17
+ s.add_dependency "globalize", [">= 5.0.0", "~> 5.0"]
18
+
20
19
  s.add_development_dependency "sqlite3"
20
+ s.add_development_dependency "rake"
21
21
  s.add_development_dependency "minitest", "~> 5.1"
22
22
 
23
23
  s.files = `git ls-files`.split("\n")
@@ -36,7 +36,6 @@ module Globalize::Accessors
36
36
  localized_attr_name = localized_attr_name_for(attr_name, locale)
37
37
 
38
38
  define_method :"#{localized_attr_name}=" do |value|
39
- return if !translation_caches[locale] && value.blank?
40
39
  write_attribute(attr_name, value, :locale => locale)
41
40
  translation_for(locale)[attr_name] = value
42
41
  end
@@ -1,5 +1,5 @@
1
1
  module Globalize
2
2
  module Accessors
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
@@ -61,34 +61,6 @@ class GlobalizeAccessorsTest < ActiveSupport::TestCase
61
61
  assert_equal 0, u.translations.count # count from database
62
62
  end
63
63
 
64
- test "doesn't build translations without values" do
65
- u = Unit.new(:name_en => nil, :title_pl => " ")
66
- assert_equal 0, u.translations.size
67
- end
68
-
69
- test "doesn't build translations without values even after saving" do
70
- u = Unit.new(:name_en => nil, :title_pl => " ")
71
- u.save
72
-
73
- # On Rails 4, Globalize will always create an empty translation for
74
- # the default locale
75
- # On Rails 3, Globalize will never create a translation
76
- assert u.translated_locales.exclude?(:pl)
77
- end
78
-
79
- test "persisted translations can be set to empty values" do
80
- u = Unit.new(:name_en => "test")
81
- u.save
82
- u.name_en = ""
83
- assert_equal "", u.translations.first.name
84
- end
85
-
86
- test "not persisted translations can be set to empty values" do
87
- u = Unit.new(:name_en => "test")
88
- u.name_en = ""
89
- assert_equal "", u.translations.first.name
90
- end
91
-
92
64
  test "write on new object and read on saved" do
93
65
  u = Unit.create!(:name_en => "Name en", :title_pl => "Title pl")
94
66
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: globalize-accessors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Stachewicz
@@ -12,52 +12,44 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-02-03 00:00:00.000000000 Z
15
+ date: 2015-05-15 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: globalize
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - "~>"
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
23
  version: 5.0.0
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
24
27
  type: :runtime
25
28
  prerelease: false
26
29
  version_requirements: !ruby/object:Gem::Requirement
27
30
  requirements:
28
- - - "~>"
31
+ - - ">="
29
32
  - !ruby/object:Gem::Version
30
33
  version: 5.0.0
31
- - !ruby/object:Gem::Dependency
32
- name: bundler
33
- requirement: !ruby/object:Gem::Requirement
34
- requirements:
35
34
  - - "~>"
36
35
  - !ruby/object:Gem::Version
37
- version: 1.7.2
38
- type: :development
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- requirements:
42
- - - "~>"
43
- - !ruby/object:Gem::Version
44
- version: 1.7.2
36
+ version: '5.0'
45
37
  - !ruby/object:Gem::Dependency
46
- name: rake
38
+ name: sqlite3
47
39
  requirement: !ruby/object:Gem::Requirement
48
40
  requirements:
49
- - - "~>"
41
+ - - ">="
50
42
  - !ruby/object:Gem::Version
51
- version: 0.9.2
43
+ version: '0'
52
44
  type: :development
53
45
  prerelease: false
54
46
  version_requirements: !ruby/object:Gem::Requirement
55
47
  requirements:
56
- - - "~>"
48
+ - - ">="
57
49
  - !ruby/object:Gem::Version
58
- version: 0.9.2
50
+ version: '0'
59
51
  - !ruby/object:Gem::Dependency
60
- name: sqlite3
52
+ name: rake
61
53
  requirement: !ruby/object:Gem::Requirement
62
54
  requirements:
63
55
  - - ">="
@@ -128,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
120
  version: '1.3'
129
121
  requirements: []
130
122
  rubyforge_project: globalize-accessors
131
- rubygems_version: 2.4.5
123
+ rubygems_version: 2.4.6
132
124
  signing_key:
133
125
  specification_version: 4
134
126
  summary: Define methods for accessing translated attributes