Class: SpudBanner

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

Instance Method Summary collapse

Instance Method Details

#dynamic_stylesObject



18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/models/spud_banner.rb', line 18

def dynamic_styles
  styles = {
    :spud_admin_small => '300x150'
  }
  owner_style = nil
  if self.owner
    owner_style = "#{self.owner.width}x#{self.owner.height}"
    owner_style += '#' if self.owner.cropped
    styles[:banner] = owner_style
  end
  return styles
end

#set_nameObject



31
32
33
# File 'app/models/spud_banner.rb', line 31

def set_name
  return owner.name
end