File tree 1 file changed +38
-0
lines changed
1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Activate the gem you are reporting the issue against.
2
+ gem 'activerecord' , '4.2.0'
3
+ gem 'globalize' , '5.0.1'
4
+ require 'active_record'
5
+ require 'globalize'
6
+ require 'minitest/autorun'
7
+ require 'logger'
8
+
9
+ # Ensure backward compatibility with Minitest 4
10
+ Minitest ::Test = MiniTest ::Unit ::TestCase unless defined? ( Minitest ::Test )
11
+
12
+ # This connection will do for database-independent bug reports.
13
+ ActiveRecord ::Base . establish_connection ( adapter : 'sqlite3' , database : ':memory:' )
14
+ ActiveRecord ::Base . logger = Logger . new ( STDOUT )
15
+
16
+ ActiveRecord ::Schema . define do
17
+ create_table :posts , force : true do |t |
18
+ end
19
+
20
+ create_table :post_translations , force : true do |t |
21
+ t . references :post
22
+ t . string :title
23
+ t . text :content
24
+ t . string :locale
25
+ end
26
+ end
27
+
28
+ class Post < ActiveRecord ::Base
29
+ translates :content , :title
30
+ end
31
+
32
+ class BugTest < Minitest ::Test
33
+ def test_association_stuff
34
+ post = Post . create! ( title : 'HI' )
35
+
36
+ assert_equal 'HI' , post . title
37
+ end
38
+ end
You can’t perform that action at this time.
0 commit comments