nosweat 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/nosweat.rb +6 -1
  2. metadata +1 -1
data/lib/nosweat.rb CHANGED
@@ -7,5 +7,10 @@
7
7
  #require 'nosweat/coder'
8
8
 
9
9
  class ActiveRecord::Base
10
- default_scope :order => 'article DESC'
10
+ def self.asc(str)
11
+ default_scope :order => "#{str}"
12
+ end
13
+ def self.desc(str)
14
+ default_scope :order => "#{str} DESC"
15
+ end
11
16
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: nosweat
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.4
5
+ version: 0.0.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - jesse