flash_speaker 0.0.1.2 → 0.0.1.3
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 +4 -4
- data/lib/flash_speaker.rb +6 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d045605fbb11dab2c031efd02a4a7f2aaa215c8b
|
4
|
+
data.tar.gz: 198cf9fdb36e604a2569ec769c5c0b53f18e4b17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b3aec8e9a44c55a0424f50234cd1ee66eb6be90a1d9db306ae5e594021ee9a3f385c776333d1c5af8f0417c25d16f6794fcdff48f3e58bc1b5fa86ae11b4ad7
|
7
|
+
data.tar.gz: f498c1fb0b168215211ad5e7c9ff6c15ad59132495fc73d96cf996adcbf9cefa510d72dcd9d46fb348afde2ca1df8fb9f2ae9d00224080ecafb00186280d59fd
|
data/lib/flash_speaker.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
module FlashSpeaker
|
2
|
-
def attach_message(success_flag, entity_errors = nil)
|
2
|
+
def attach_message(success_flag, entity_errors = nil, t_params = {})
|
3
3
|
flash_type = success_flag ? :success : :failed
|
4
4
|
flash[:errors] = entity_errors if entity_errors.present?
|
5
|
-
flash[flash_type] = message(flash_type)
|
5
|
+
flash[flash_type] = message(flash_type, t_params)
|
6
6
|
end
|
7
7
|
|
8
8
|
private
|
9
9
|
|
10
|
-
def message(flash_type)
|
10
|
+
def message(flash_type, t_params = {})
|
11
11
|
case
|
12
12
|
when message_exists?(message_path(flash_type))
|
13
|
-
t message_path(flash_type)
|
13
|
+
t message_path(flash_type), t_params
|
14
14
|
when message_exists?(default_message_path(flash_type))
|
15
|
-
msg = t default_message_path(flash_type)
|
15
|
+
msg = t default_message_path(flash_type), t_params
|
16
16
|
msg.sub('<entity>', entity_name)
|
17
17
|
else
|
18
|
-
raise "translation missing: #{message_path}"
|
18
|
+
raise "translation missing: #{message_path(flash_type)}"
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flash_speaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kris Aberfort
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails-i18n
|
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
version: '0'
|
55
55
|
requirements: []
|
56
56
|
rubyforge_project:
|
57
|
-
rubygems_version: 2.
|
57
|
+
rubygems_version: 2.4.8
|
58
58
|
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: Simplify organizing your flash messages
|