Skip to content

Commit

Permalink
updated use of friendly_id to 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kristianmandrup committed Mar 28, 2012
1 parent 16fac60 commit b8c1f23
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ group :test do

# Integration testing
gem 'decent_exposure'
gem "friendly_id"
gem "friendly_id", "~> 4.0.1"
gem "devise", '>= 1.4'

# Rails
Expand Down
6 changes: 4 additions & 2 deletions spec/devise-dummy/app/models/article.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class Article < ActiveRecord::Base
belongs_to :author, :foreign_key => 'user_id', :class_name => "User"
extend FriendlyId

has_friendly_id :title
belongs_to :author, :foreign_key => 'user_id', :class_name => "User"

friendly_id :title #, :use => :slugged
end

4 changes: 3 additions & 1 deletion spec/devise-dummy/app/models/concerto.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class Concerto < ActiveRecord::Base
extend FriendlyId

belongs_to :author, :foreign_key => 'user_id', :class_name => "User"

has_friendly_id :title
friendly_id :title
end

4 changes: 3 additions & 1 deletion spec/devise-dummy/app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class User < ActiveRecord::Base
extend FriendlyId

devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable

Expand All @@ -13,7 +15,7 @@ class User < ActiveRecord::Base

tango_user # see macros

has_friendly_id :name
friendly_id :name

has_many :articles
has_many :comments
Expand Down
4 changes: 3 additions & 1 deletion spec/dummy/app/models/article.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class Article < ActiveRecord::Base
extend FriendlyId

belongs_to :author, :foreign_key => 'user_id', :class_name => "User"

has_friendly_id :title
friendly_id :title
end

4 changes: 3 additions & 1 deletion spec/dummy/app/models/concerto.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class Concerto < ActiveRecord::Base
extend FriendlyId

belongs_to :author, :foreign_key => 'user_id', :class_name => "User"

has_friendly_id :title
friendly_id :title
end

4 changes: 3 additions & 1 deletion spec/dummy/app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
class User < ActiveRecord::Base
extend FriendlyId

include_and_extend SimpleRoles

tango_user # see macros
masquerader

has_friendly_id :name
friendly_id :name

has_many :articles
has_many :comments
Expand Down

0 comments on commit b8c1f23

Please sign in to comment.