tkh_authentication 0.1.5 → 0.1.6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
 
4
4
 
5
+ ## 0.1.6
6
+
7
+ * Added a formal_name virtual attribute to the user model
8
+ * Added the alphabetically scope to the user model
9
+
10
+
5
11
  ## 0.1.5
6
12
 
7
13
  * Modified the login info in sidebar partial
data/app/models/user.rb CHANGED
@@ -15,6 +15,8 @@ class User < ActiveRecord::Base
15
15
  validates_presence_of :first_name
16
16
  validates_presence_of :last_name
17
17
 
18
+ scope :alphabetically, order('last_name, first_name')
19
+
18
20
  before_create { generate_token(:auth_token) }
19
21
 
20
22
  # use the stringex gem to create slug | usually on the title or name attribute
@@ -25,7 +27,11 @@ class User < ActiveRecord::Base
25
27
  scope :by_recent, :order => 'updated_at desc'
26
28
 
27
29
  def name
28
- result = "#{first_name} #{last_name}".strip
30
+ "#{first_name} #{last_name}".strip
31
+ end
32
+
33
+ def formal_name
34
+ "#{last_name}, #{first_name}".strip
29
35
  end
30
36
 
31
37
  def send_password_reset
@@ -1,3 +1,3 @@
1
1
  module TkhAuthentication
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-03 00:00:00.000000000 Z
12
+ date: 2013-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -178,7 +178,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
178
178
  version: '0'
179
179
  segments:
180
180
  - 0
181
- hash: -1539702950156840883
181
+ hash: -2123591909032779607
182
182
  required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  none: false
184
184
  requirements:
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  version: '0'
188
188
  segments:
189
189
  - 0
190
- hash: -1539702950156840883
190
+ hash: -2123591909032779607
191
191
  requirements: []
192
192
  rubyforge_project:
193
193
  rubygems_version: 1.8.23