Class: Droom::Organisation

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.for_selectionObject



11
12
13
14
15
# File 'app/models/droom/organisation.rb', line 11

def self.for_selection
  organisations = self.order("name asc").map{|f| [f.name, f.id] }
  organisations.unshift(['', ''])
  organisations
end

Instance Method Details

#url_with_protocolObject



17
18
19
# File 'app/models/droom/organisation.rb', line 17

def url_with_protocol
  url =~ /^https?:\/\// ? url : "http://#{url}"
end

#url_without_protocolObject



21
22
23
# File 'app/models/droom/organisation.rb', line 21

def url_without_protocol
  url.sub(/^https?:\/\//, '')
end