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.
22 23 24 25 26 27 |
# File 'app/models/spree/page.rb', line 22 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
29 30 31 |
# File 'app/models/spree/page.rb', line 29 def link foreign_link.blank? ? slug : foreign_link end |