Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from nzbrn/add_boolean_datatype_to_observation…
…_fields Add boolean datatypes to observation fields
- Loading branch information
Showing
10 changed files
with
128 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class ProFieldset < ActiveRecord::Base | ||
belongs_to :observation | ||
validates_presence_of :observation_id | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<%- observation ||= object ||= @observation -%> | ||
<%- top = capture do %> | ||
<% unless observation.photos.empty? -%> | ||
<div class="bigphotos"> | ||
<%= render :partial => 'observations/photos', :object => observation %> | ||
</div> | ||
<% end -%> | ||
<%- end -%> | ||
<%= render :partial => "observations/observation_component", :object => observation, :locals => { | ||
:top => top | ||
} %> | ||
<%- top = capture do %> | ||
<% unless observation.photos.empty? -%> | ||
<div class="bigphotos"> | ||
<%= render :partial => 'observations/photos', :object => observation %> | ||
</div> | ||
<% end -%> | ||
<%- end -%> | ||
<%= render :partial => "observations/observation_component", :object => observation, :locals => { | ||
:top => top | ||
} %> | ||
<% if @observaiton %> | ||
<%= render :partial => "comments/comments", :locals => { :parent => @observation } %> | ||
<%= render :partial => "comments/comments", :locals => { :parent => @observation } %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div class="pro_observation_fields"> | ||
<br clear="all" /> | ||
<h3>Pro Fields</h3> | ||
<% if !pro_fieldset.second_hand.nil? %> | ||
<div> | ||
<label>Second Hand</label> | ||
<span class="pro_field_value"><%=pro_fieldset.second_hand %></span> | ||
</div> | ||
<% end %> | ||
<% if !pro_fieldset.uncertain.nil? %> | ||
<div> | ||
<label>Uncertain</label> | ||
<span class="pro_field_value"><%=pro_fieldset.uncertain %></span> | ||
</div> | ||
<% end %> | ||
<% if !pro_fieldset.escaped.nil? %> | ||
<div> | ||
<label>Escaped</label> | ||
<span class="pro_field_value"><%=pro_fieldset.escaped %></span> | ||
</div> | ||
<% end %> | ||
<% if !pro_fieldset.planted.nil? %> | ||
<div> | ||
<label>Planted</label> | ||
<span class="pro_field_value"><%=pro_fieldset.planted %></span> | ||
</div> | ||
<% end %> | ||
<% if !pro_fieldset.ecologically_significant.nil? %> | ||
<div> | ||
<label>Ecologically Significant</label> | ||
<span class="pro_field_value"><%=pro_fieldset.ecologically_significant %></span> | ||
</div> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class CreateProFieldsets < ActiveRecord::Migration | ||
def self.up | ||
create_table :pro_fieldsets do |t| | ||
t.integer :observation_id | ||
t.boolean :second_hand, :default => false | ||
t.boolean :uncertain, :default => false | ||
t.boolean :escaped, :default => false | ||
t.boolean :planted, :default => false | ||
t.boolean :ecologically_significant, :default => false | ||
|
||
t.timestamps | ||
end | ||
end | ||
|
||
def self.down | ||
drop_table :pro_fieldsets | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters