Class: Droom::Organisation
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Droom::Organisation
- Defined in:
- app/models/droom/organisation.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.for_selection ⇒ Object
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_protocol ⇒ Object
17 18 19 |
# File 'app/models/droom/organisation.rb', line 17 def url_with_protocol url =~ /^https?:\/\// ? url : "http://#{url}" end |
#url_without_protocol ⇒ Object
21 22 23 |
# File 'app/models/droom/organisation.rb', line 21 def url_without_protocol url.sub(/^https?:\/\//, '') end |