Skip to content

Commit

Permalink
Fixed chain backend to not drop options while transfering to backend
Browse files Browse the repository at this point in the history
  • Loading branch information
pyromaniac authored and knapo committed Mar 24, 2011
1 parent 1b3e434 commit 8ad0f4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/i18n/backend/chain.rb
Expand Up @@ -29,7 +29,7 @@ def reload!
end

def store_translations(locale, data, options = {})
backends.first.store_translations(locale, data, options = {})
backends.first.store_translations(locale, data, options)
end

def available_locales
Expand Down
5 changes: 5 additions & 0 deletions test/backend/chain_test.rb
Expand Up @@ -57,6 +57,11 @@ def setup
assert_equal [{ :short => 'short', :long => 'long' }, { :one => 'one' }, 'Bah'], I18n.t([:formats, :plural_2, :bah], :default => 'Bah')
end

test "store_translations options are not dropped while transfering to backend" do
@first.expects(:store_translations).with(:foo, {:bar => :baz}, {:option => 'persists'})
I18n.backend.store_translations :foo, {:bar => :baz}, {:option => 'persists'}
end

protected

def backend(translations)
Expand Down

0 comments on commit 8ad0f4b

Please sign in to comment.