Class: Spree::Page

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/spree/page.rb

Instance Method Summary collapse

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



21
22
23
# File 'app/models/spree/page.rb', line 21

def link
  foreign_link.blank? ? slug_link : foreign_link
end