Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
4 app/models/club.rb
@@ -5,11 +5,11 @@ class Club < ActiveRecord::Base
has_many :competitors
validates :name, :presence => true, :uniqueness => { :scope => :race_id }
- validates :longname, :allow_nil => true, :uniqueness => { :scope => :race_id }
+ validates :long_name, :allow_nil => true, :uniqueness => { :scope => :race_id }
before_destroy :check_competitors
- def club_for_tc_results
+ def expanded
return longname if longname
name
end
View
6 app/views/official/clubs/index.html.erb
@@ -8,7 +8,7 @@
<%= form_for([:official, @race, Club.new], :remote => true) do |f| %>
<%= f.label :name %>
<%= f.text_field :name %>
- <%= f.text_field :longname %>
+ <%= f.text_field :long_name %>
<%= submit_tag 'Lisää seura', :id => 'submit' %>
<span id="spinner"></span>
<% end %>
@@ -36,12 +36,12 @@
<span id="club_name_form_<%= club.id %>" style="display: none;">
<%= form_for([:official, @race, club], :remote => true,
:html => { :style => 'display:inline;' }) do |f| %>
- <%= f.text_field :name %><%= f.text_field :longname %><%= submit_tag "Päivitä" %>
+ <%= f.text_field :name %><%= f.text_field :long_name %><%= submit_tag "Päivitä" %>
<% end %>
<%= button_to_function 'Peruuta', "cancel_edit(#{club.id}, \"#{club.name}\")" %>
</span>
</td>
- <td><%= club.longname %></td>
+ <td><%= club.long_name %></td>
<td class="center"><%= club.competitors.count %></td>
<td class="center"><%= club.competitors.count == 0 ? (link_to "Poista",
official_race_club_path(@race.id, club),
View
4 spec/models/club_spec.rb
@@ -42,12 +42,12 @@
describe "#result_name" do
it "should return long name when long name set" do
club = Factory.create(:club, :name => 'PS', :long_name => 'Pohjois-Savo')
- club.club_for_tc_results.should == 'Pohjois-Savo'
+ club.expanded.should == 'Pohjois-Savo'
end
it "should return name when long name not set" do
club = Factory.create(:club, :name => 'PS')
- club.club_for_tc_results.should == 'PS'
+ club.expanded.should == 'PS'
end
end
end

No commit comments for this range

Something went wrong with that request. Please try again.