Class: Odania::Content

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/odania/content.rb

Instance Method Summary collapse

Instance Method Details

#to_paramObject



18
19
20
# File 'app/models/odania/content.rb', line 18

def to_param
	"#{self.id}-#{self.title.parameterize}"
end

#validate_widgetObject



22
23
24
25
26
# File 'app/models/odania/content.rb', line 22

def validate_widget
	if !self.widget_id.nil? and !self.site_id.eql?(self.widget.site_id)
		errors.add(:widget_id, 'invalid widget')
	end
end