mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-12-17 02:44:17 +00:00
first commit of a million rails snippets, conditions missing, command implementation missing...
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vaoif
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_acceptance_of if
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_acceptance_of :${1:terms}${2:${3:, :accept => "${4:1}"}${5:, :message => "${6:You must accept the terms of service}"}}, :if => proc { |obj| ${7:obj.condition?} }
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vao
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_acceptance_of
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_acceptance_of :${1:terms}${2:${3:, :accept => "${4:1}"}${5:, :message => "${6:You must accept the terms of service}"}}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: va
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_associated
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_associated :${1:attribute}${2:, :on => :${3:create}}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vaif
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_associated if
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_associated :${1:attribute}${2:, :on => :${3:create}, :if => proc { |obj| ${5:obj.condition?} }}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vc
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_confirmation_of
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_confirmation_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:should match confirmation}"}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vcif
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_confirmation_of if
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_confirmation_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:should match confirmation}", :if => proc { |obj| ${5:obj.condition?} }}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: ve
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_exclusion_of
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_exclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not allowed}"}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: veif
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_exclusion_of if
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_exclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not allowed}"}, :if => proc { |obj| ${7:obj.condition?} }
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vfif
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_format_of if
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_format_of :${1:attribute}, :with => /${2:^[${3:\w\d}]+\$}/${4:, :on => :${5:create}, :message => "${6:is invalid}"}, :if => proc { |obj| ${7:obj.condition?} }
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vf
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_format_of
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_format_of :${1:attribute}, :with => /${2:^[${3:\w\d}]+\$}/${4:, :on => :${5:create}, :message => "${6:is invalid}"}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: viif
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_inclusion_of if
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_inclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not included in the list}"}, :if => proc { |obj| ${7:obj.condition?} }
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vi
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_inclusion_of
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_inclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not included in the list}"}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vl
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_length_of
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_length_of :${1:attribute}, :within => ${2:3..20}${3:, :on => :${4:create}, :message => "${5:must be present}"}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vlif
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_length_of if
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_length_of :${1:attribute}, :within => ${2:3..20}${3:, :on => :${4:create}, :message => "${5:must be present}"}, :if => proc { |obj| ${6:obj.condition?} }
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vnif
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_numericality_of if
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_numericality_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:is not a number}"}, :if => proc { |obj| ${5:obj.condition?} }}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vn
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_numericality_of
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_numericality_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:is not a number}"}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vp
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_presence_of
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_presence_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:can't be blank}"}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vpif
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_presence_of if
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_presence_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:can't be blank}"}, :if => proc { |obj| ${5:obj.condition?} }
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vu
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_uniqueness_of
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_uniqueness_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:must be unique}"}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: vuif
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: validates_uniqueness_of if
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
validates_uniqueness_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:must be unique}", :if => proc { |obj| ${6:obj.condition?} }}
|
||||
Reference in New Issue
Block a user