Skip to content

Commit

Permalink
Merge pull request #26 from nzbrn/add_sought_not_found_to_observation
Browse files Browse the repository at this point in the history
Add sought not found to observation
  • Loading branch information
Kale Worsley committed Mar 7, 2012
2 parents dd68868 + bdec9ad commit 94515d9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/views/observations/_form_fields.html.erb
Expand Up @@ -42,6 +42,10 @@
<%= o.label(:number_individuals, 'Number of individuals') %>
<%= o.text_field(:number_individuals) %>
</div>
<div class="field">
<%= o.label(:sought_not_found, 'Sought but not found') %>
<%= o.check_box(:sought_not_found) %>
</div>
<div class="field">
<%= o.label(:description, 'Description') %>
<%= o.text_area(:description, :class => "text") %>
Expand Down
6 changes: 5 additions & 1 deletion app/views/observations/show.html.erb
Expand Up @@ -317,7 +317,11 @@
<%= @observation.sex %>
</div>
<% end %>
<% if @observation.sought_not_found %>
<div class="description">
Species was sought for but not found
</div>
<% end %>
<% unless @observation.number_individuals.blank? %>
<div class="description">
<label>Number of individuals:</label>
Expand Down
@@ -0,0 +1,9 @@
class AddSoughtNotFoundToObservation < ActiveRecord::Migration
def self.up
add_column :observations, :sought_not_found, :boolean, :default => false
end

def self.down
remove_column :observations, :sought_not_found
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Expand Up @@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20120307031141) do
ActiveRecord::Schema.define(:version => 20120307034116) do

create_table "activity_streams", :force => true do |t|
t.integer "user_id"
Expand Down Expand Up @@ -366,6 +366,7 @@
t.point "geom", :limit => nil
t.integer "number_individuals"
t.string "sex"
t.boolean "sought_not_found", :default => false
end

add_index "observations", ["geom"], :name => "index_observations_on_geom", :spatial => true
Expand Down

0 comments on commit 94515d9

Please sign in to comment.