locale_mailer 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 991fd4e039b610e59c3a7931e3ac33152c91cb14
4
- data.tar.gz: e896a44e5623e26fd90da6ea88941ce587f660cd
3
+ metadata.gz: 0189bbf06524259144c518b694d468179404bdbf
4
+ data.tar.gz: 8dff893af987c86414e8b8f440f5c09d4212299f
5
5
  SHA512:
6
- metadata.gz: a60553225e034aa5af897f3c68d1af9d0c8abadf0abf477edb977ee909d663bda8b915c4dfdc855e3c7fffbfcd02e7c83219b460d0f3735d7efea51e780c3302
7
- data.tar.gz: 61aba9f059b18ec8d5d85f15a3f63c911f3af38a72cecd758c496c928723bec07f2ab1d0615505d93be4cb3dcf751b4e15e313821a29a8e0398128427cc9032b
6
+ metadata.gz: 70ff16922cb1bee954f087f6655bd9b20e4f7afbc74f633e5ff606ed25694c63e1340c6cf1b35e118ca32bf20f1b03a8dec0158d54e1af96a0fbdda4697f259f
7
+ data.tar.gz: 25f125a438ba4916ce9da63443058109577008162ccdfbd05c44b9d935d1bd018498108137ecb04526ee3711d017fe3b421e01c2cba18e7d1793754bfaa01042
@@ -56,7 +56,7 @@ module LocaleMailer
56
56
  ].compact.join('.')
57
57
  end
58
58
 
59
- def action_i18n_options
59
+ def action_i18n_options options = {}
60
60
  @action_i18n_options ||= instance_variables.inject({}) do |memo, name|
61
61
  if name.to_s.match(/\A@(?!_).*/) and not name.to_s.match(/\A@action_i18n_/)
62
62
  if instance_variable_get(name).try(:as_json).is_a? Hash
@@ -68,7 +68,7 @@ module LocaleMailer
68
68
  end
69
69
  end
70
70
  memo
71
- end
71
+ end.update(scope: action_i18n_path(options))
72
72
  end
73
73
 
74
74
  def flatten_hash(hash)
@@ -84,12 +84,11 @@ module LocaleMailer
84
84
  end
85
85
 
86
86
  def subject_from_locale options
87
- view_context.t([action_i18n_path(options), :subject].join('.'), action_i18n_options)
87
+ view_context.t 'subject', action_i18n_options(options)
88
88
  end
89
89
 
90
90
  def body_from_locale options
91
- render inline: view_context.text([action_i18n_path(options), :body].join('.'), action_i18n_options),
92
- layout: options[:layout] || _layout
91
+ render inline: view_context.text('body', action_i18n_options(options)), layout: options[:layout] || _layout
93
92
  end
94
93
 
95
94
  end
@@ -1,3 +1,3 @@
1
1
  module LocaleMailer
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locale_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - itkin