first commit of a million rails snippets, conditions missing, command implementation missing...

This commit is contained in:
capitaomorte
2009-11-16 07:09:38 +00:00
parent ead36b2544
commit 96b5606d66
213 changed files with 1592 additions and 0 deletions

View File

@@ -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?} }

View File

@@ -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}"}}

View File

@@ -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}}

View File

@@ -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?} }}

View File

@@ -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}"}

View File

@@ -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?} }}

View File

@@ -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}"}

View File

@@ -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?} }

View File

@@ -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?} }

View File

@@ -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}"}

View File

@@ -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?} }

View File

@@ -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}"}

View File

@@ -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}"}

View File

@@ -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?} }

View File

@@ -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?} }}

View File

@@ -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}"}

View File

@@ -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}"}

View File

@@ -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?} }

View File

@@ -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}"}

View File

@@ -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?} }}