Permalink
Browse files

Updated named_scope to scope (Rails 3) and changed all associations s…

…nippets to meta.rails.model scope.
  • Loading branch information...
1 parent f5a049d commit 3b74b5fcd5c4a00deb3203197de5fe82af65b11c @carlosbrando carlosbrando committed Jun 23, 2010
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
- <string>assert_response :${1:success}, @response.body$0</string>
+ <string>assert_response :${1:success}${2:, @response.body}$0</string>
<key>name</key>
<string>assert_response</string>
<key>scope</key>
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
- <string>assert_difference "${1:Model}.${2:count}", ${3:1} do
+ <string>assert_difference "${1:Model}.${2:count}", ${3:+1} do
$0
end</string>
<key>name</key>
@@ -7,7 +7,7 @@
<key>name</key>
<string>belongs_to</string>
<key>scope</key>
- <string>source.rails.model</string>
+ <string>meta.rails.model</string>
<key>tabTrigger</key>
<string>bt</string>
<key>uuid</key>
@@ -3,13 +3,13 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>default_scope :${1:order} =&gt; ${2:'created_at DESC'}${3:, :joins =&gt; :${4:table}}</string>
+ <string>default_scope ${1:order(${2:'${3:created_at DESC}'})}</string>
<key>name</key>
<string>default_scope</string>
<key>scope</key>
- <string>source.ruby.rails</string>
+ <string>meta.rails.model</string>
<key>tabTrigger</key>
- <string>dc</string>
+ <string>dscope</string>
<key>uuid</key>
<string>83B80B60-6143-4465-B064-0DA25DDDCAA7</string>
</dict>
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>has_and_belongs_to_many :${1:object}${2:, :join_table =&gt; "${3:table_name}", :foreign_key =&gt; "${4:${1}_id}"}</string>
<key>name</key>
<string>has_and_belongs_to_many</string>
<key>scope</key>
- <string>source.ruby.rails</string>
+ <string>meta.rails.model</string>
<key>tabTrigger</key>
<string>habtm</string>
<key>uuid</key>
@@ -7,7 +7,7 @@
<key>name</key>
<string>has_many</string>
<key>scope</key>
- <string>source.ruby.rails</string>
+ <string>meta.rails.model</string>
<key>tabTrigger</key>
<string>hm</string>
<key>uuid</key>
@@ -7,7 +7,7 @@
<key>name</key>
<string>has_many (through)</string>
<key>scope</key>
- <string>source.ruby.rails</string>
+ <string>meta.rails.model</string>
<key>tabTrigger</key>
<string>hmt</string>
<key>uuid</key>
@@ -7,7 +7,7 @@
<key>name</key>
<string>has_many :dependent =&gt; :destroy</string>
<key>scope</key>
- <string>source.ruby.rails</string>
+ <string>meta.rails.model</string>
<key>tabTrigger</key>
<string>hmd</string>
<key>uuid</key>
@@ -7,7 +7,7 @@
<key>name</key>
<string>has_one</string>
<key>scope</key>
- <string>source.ruby.rails</string>
+ <string>meta.rails.model</string>
<key>tabTrigger</key>
<string>ho</string>
<key>uuid</key>
@@ -3,15 +3,14 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>named_scope :${1:name}${2:, :joins =&gt; :${3:table}}, :conditions =&gt; ${4:['${5:${6:field} = ?}', ${7:true}]}
-</string>
+ <string>scope :${1:name}, lambda { |${2:param}| ${3:where(${4::${5:field} =&gt; ${6:"${7:value}"}})} }</string>
<key>name</key>
- <string>named_scope</string>
+ <string>scope lambda</string>
<key>scope</key>
- <string>source.ruby.rails</string>
+ <string>meta.rails.model</string>
<key>tabTrigger</key>
- <string>nc</string>
+ <string>scopel</string>
<key>uuid</key>
- <string>1CB65A0D-4FEC-4438-9B4F-8B0BD13FB875</string>
+ <string>5D01527E-48FA-4A3D-A10B-A383C8AE3942</string>
</dict>
</plist>
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>scope :${1:name}, ${2:where(${3::${4:field} =&gt; ${5:'${6:value}'}})} do
+ def ${7:method_name}
+ $0
+ end
+end</string>
+ <key>name</key>
+ <string>scope with extension</string>
+ <key>scope</key>
+ <string>meta.rails.model</string>
+ <key>tabTrigger</key>
+ <string>scopee</string>
+ <key>uuid</key>
+ <string>CEA1D76C-DEB0-4ADB-840D-220E569D5B8F</string>
+</dict>
+</plist>
@@ -3,15 +3,14 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>named_scope :${1:name}, lambda { |${2:param}| { :conditions =&gt; ${3:['${4:${5:field} = ?}', ${6:$2}]} } }
-</string>
+ <string>scope :${1:name}, ${2:joins(:${3:table}).}where(${4:'${5:$3.${6:field}} = ?', ${7:'${8:value}'}})</string>
<key>name</key>
- <string>named_scope lambda</string>
+ <string>scope</string>
<key>scope</key>
- <string>source.ruby.rails</string>
+ <string>meta.rails.model</string>
<key>tabTrigger</key>
- <string>ncl</string>
+ <string>scope</string>
<key>uuid</key>
- <string>4E286CB4-069E-474C-A970-95216FE7DE95</string>
+ <string>8F87F3C7-8ABB-4778-9786-64CF95E99160</string>
</dict>
</plist>
@@ -303,7 +303,7 @@
</dict>
<dict>
<key>match</key>
- <string>\b(named_scope|after_create|after_destroy|after_save|after_update|after_validation|after_validation_on_create|after_validation_on_update|before_create|before_destroy|before_save|before_update|before_validation|before_validation_on_create|before_validation_on_update|composed_of|belongs_to|has_one|has_many|has_and_belongs_to_many|validate|validate_on_create|validates_numericality_of|validate_on_update|validates_acceptance_of|validates_associated|validates_confirmation_of|validates_each|validates_format_of|validates_inclusion_of|validates_exclusion_of|validates_length_of|validates_presence_of|validates_size_of|validates_uniqueness_of|attr_protected|attr_accessible|attr_readonly|accepts_nested_attributes_for|default_scope)\b</string>
+ <string>\b(after_create|after_destroy|after_save|after_update|after_validation|after_validation_on_create|after_validation_on_update|before_create|before_destroy|before_save|before_update|before_validation|before_validation_on_create|before_validation_on_update|composed_of|belongs_to|has_one|has_many|has_and_belongs_to_many|validate|validate_on_create|validates_numericality_of|validate_on_update|validates_acceptance_of|validates_associated|validates_confirmation_of|validates_each|validates_format_of|validates_inclusion_of|validates_exclusion_of|validates_length_of|validates_presence_of|validates_size_of|validates_uniqueness_of|attr_protected|attr_accessible|attr_readonly|accepts_nested_attributes_for|default_scope|scope)\b</string>
<key>name</key>
<string>support.function.activerecord.rails</string>
</dict>
View
@@ -27,6 +27,8 @@
<string>43304E62-66F7-424D-8AF6-33E0237BF349</string>
<string>786980D8-FA69-4542-85A3-5E48CFAA6814</string>
<string>47A6800A-DC7E-4F72-AA0D-CEE2488E1618</string>
+ <string>1CB65A0D-4FEC-4438-9B4F-8B0BD13FB875</string>
+ <string>4E286CB4-069E-474C-A970-95216FE7DE95</string>
</array>
<key>description</key>
<string>&lt;a href="http://www.rubyonrails.com/"&gt;Ruby on Rails&lt;/a&gt; is a full-stack framework for developing database-backed web applications, in Ruby, according to the Model-View-Control pattern.</string>
@@ -144,8 +146,10 @@
<dict>
<key>items</key>
<array>
- <string>1CB65A0D-4FEC-4438-9B4F-8B0BD13FB875</string>
- <string>4E286CB4-069E-474C-A970-95216FE7DE95</string>
+ <string>8F87F3C7-8ABB-4778-9786-64CF95E99160</string>
+ <string>5D01527E-48FA-4A3D-A10B-A383C8AE3942</string>
+ <string>CEA1D76C-DEB0-4ADB-840D-220E569D5B8F</string>
+ <string>------------------------------------</string>
<string>83B80B60-6143-4465-B064-0DA25DDDCAA7</string>
</array>
<key>name</key>
@@ -936,8 +940,9 @@
<string>B660FC85-F69A-43BC-A72A-748CBEA0AA9A</string>
<string>B105C480-FB21-4511-9AD0-D5B4FED3BA21</string>
<string>7CC002AE-83BA-4294-B87D-DE9790839D97</string>
- <string>1CB65A0D-4FEC-4438-9B4F-8B0BD13FB875</string>
- <string>4E286CB4-069E-474C-A970-95216FE7DE95</string>
+ <string>8F87F3C7-8ABB-4778-9786-64CF95E99160</string>
+ <string>5D01527E-48FA-4A3D-A10B-A383C8AE3942</string>
+ <string>CEA1D76C-DEB0-4ADB-840D-220E569D5B8F</string>
<string>83B80B60-6143-4465-B064-0DA25DDDCAA7</string>
<string>7B15B396-1F41-4529-9253-32761E94448C</string>
<string>D975E5C1-42C2-40F1-8960-0DA533B18113</string>

0 comments on commit 3b74b5f

Please sign in to comment.