acts_as_ordered 0.0.1.alpha → 0.0.2.alpha

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,20 +1,14 @@
1
1
  module ActsAsOrdered
2
- def acts_as_ordered(column=nil, direction=nil)
2
+ def acts_as_ordered(column = 'position', direction = 'asc')
3
3
 
4
4
  @acts_as_ordered = {}
5
5
 
6
6
  if column
7
- if self.column_names.include?(column.to_s)
8
- @acts_as_ordered[:column] = column
9
- else
10
- raise 'Invalid Acts as Ordered default column'
11
- end
7
+ @acts_as_ordered[:column] = column
12
8
  end
13
9
 
14
- if direction
15
- if %w(asc desc).include?(direction.to_s)
16
- @acts_as_ordered[:direction] = direction
17
- end
10
+ if %w(asc desc).include?(direction.to_s)
11
+ @acts_as_ordered[:direction] = direction
18
12
  end
19
13
 
20
14
  scope :ordered, lambda{|column=nil, direction=nil|
@@ -1,3 +1,3 @@
1
1
  module ActsAsOrdered
2
- VERSION = "0.0.1.alpha"
2
+ VERSION = "0.0.2.alpha"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_ordered
3
3
  version: !ruby/object:Gem::Version
4
- hash: 296151482
4
+ hash: 296151478
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
9
+ - 2
10
10
  - alpha
11
- version: 0.0.1.alpha
11
+ version: 0.0.2.alpha
12
12
  platform: ruby
13
13
  authors:
14
14
  - Semiweb
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-11-28 00:00:00 -05:00
19
+ date: 2012-01-03 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies: []
22
22