Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskv <skv-headless@yandex.ru>2014-08-02 19:12:01 +0400
committerskv <skv-headless@yandex.ru>2014-08-14 15:48:14 +0400
commit4e4080016604e2c7ca9a5e75d6dd37d34b99cb09 (patch)
tree1a443fc6b7a16828c8a4b92d1724c2f72a4024f4 /lib/gt_one_coercion.rb
parentfdd8e4507527badd875a40a0ab8a3ed47a03c764 (diff)
diff unfold
Diffstat (limited to 'lib/gt_one_coercion.rb')
-rw-r--r--lib/gt_one_coercion.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gt_one_coercion.rb b/lib/gt_one_coercion.rb
new file mode 100644
index 00000000000..ef2dc09767c
--- /dev/null
+++ b/lib/gt_one_coercion.rb
@@ -0,0 +1,5 @@
+class GtOneCoercion < Virtus::Attribute
+ def coerce(value)
+ [1, value.to_i].max
+ end
+end