Skip to content

Commit

Permalink
add rails callbak methods
Browse files Browse the repository at this point in the history
  • Loading branch information
wongyouth committed Mar 12, 2014
1 parent b2a91d1 commit 9371c64
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions snippets/ruby.snippets
Expand Up @@ -749,8 +749,45 @@ snippet mapwo
${1:map}.with_options :${2:controller} => '${3:thing}' do |$3|
${0}
end

# before callback
snippet mbv
before_validation :${0:method}
snippet mbc
before_create :${0:method}
snippet mbu
before_update :${0:method}
snippet mbs
before_save :${0:method}
snippet mbd
before_destroy :${0:method}

# after callback
snippet mav
after_validation :${0:method}
snippet maf
after_find :${0:method}
snippet mat
after_touch :${0:method}
snippet mac
after_create :${0:method}
snippet mau
after_update :${0:method}
snippet mas
after_save :${0:method}
snippet mad
after_destroy :${0:method}
snippet mrc

# around callback
around_create :${0:method}
snippet mru
around_update :${0:method}
snippet mrs
around_save :${0:method}
snippet mrd
around_destroy :${0:method}

snippet mcht
change_table :${1:table_name} do |t|
${0}
Expand Down

0 comments on commit 9371c64

Please sign in to comment.