Change summary
lib/tel_selections.rb | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
Detailed changes
@@ -141,15 +141,17 @@ class TelSelections
class Quantity
def self.for(form)
+ if form.field(ACTION_FIELD)&.value == "feelinglucky"
+ return Default.new
+ end
+
rsm_max = form.find(
"ns:set/ns:max",
ns: "http://jabber.org/protocol/rsm"
).first
- if rsm_max
- new(rsm_max.content.to_i)
- else
- Default.new
- end
+ return new(rsm_max.content.to_i) if rsm_max
+
+ Default.new
end
def initialize(quantity)