Class: Spree::Page
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spree::Page
- Defined in:
- app/models/spree/page.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ Page
constructor
A new instance of Page.
- #link ⇒ Object
Constructor Details
#initialize(*args) ⇒ Page
Returns a new instance of Page.
15 16 17 18 19 |
# File 'app/models/spree/page.rb', line 15 def initialize(*args) super(*args) last_page = Spree::Page.last self.position = last_page ? last_page.position + 1 : 0 end |
Instance Method Details
#link ⇒ Object
21 22 23 |
# File 'app/models/spree/page.rb', line 21 def link foreign_link.blank? ? slug_link : foreign_link end |