headword 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -3,9 +3,8 @@ if defined?(ActionController::Routing::RouteSet)
3
3
  def load_routes_with_headword!
4
4
  lib_path = File.dirname(__FILE__)
5
5
  routes = File.join(lib_path, *%w[.. .. .. config headword_routes.rb])
6
- unless configuration_files.include?(routes)
7
- add_configuration_file(routes)
8
- end
6
+ configuration_files.delete(routes)
7
+ add_configuration_file(routes)
9
8
  load_routes_without_headword!
10
9
  end
11
10
 
@@ -1,3 +1,5 @@
1
+ require 'stringex'
2
+
1
3
  module Headword
2
4
  module User
3
5
 
@@ -53,11 +55,18 @@ module Headword
53
55
  module InstanceMethods
54
56
  # We want to use username urls instead of ids in our routes
55
57
  def to_param
56
- url
57
- end
58
+ url
59
+ end
58
60
  end
59
61
 
60
62
  module ClassMethods
63
+ def find_by_id(id)
64
+ find_by_url(id)
65
+ end
66
+
67
+ def find_by_id_and_confirmation_token(id, token)
68
+ find(:first, :conditions => {:url => id, :confirmation_token => token})
69
+ end
61
70
  end
62
71
  end
63
72
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: headword
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Rafter
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-08 00:00:00 -07:00
12
+ date: 2009-10-11 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency