This file contains hidden or 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
_ ,-, _ | |
,--, /: :\/': :`\/: :\ | |
|`; ' `,' `.; `: | | |
| N | E | R | D |. | |
| :L | I | F | E || | |
| :. | : | . | : | \ | |
\__/: :.. : :.. | :.. | ) | |
`---',\___/,\___/ /' | |
`==._ .. . /' | |
`-::-' |
This file contains hidden or 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
class Diaria < ActiveRecord::Base | |
has_many :itens, :class_name => "DiariaItem" | |
def gerarItensDiaria | |
itens.create({:tipo => 3, | |
:quantidade => diaria_com_pernoite, | |
:valor => 150.00}) | |
end | |
end |
This file contains hidden or 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
create_table "permits", :force => true do |t| | |
t.string "number", :null => false | |
t.string "name", :null => false | |
t.string "agency_project" | |
t.integer "contact_id" | |
t.string "category" | |
t.string "when_req" | |
t.string "owner" | |
t.string "renewable" | |
t.boolean "startup_monitoring_reqd" |
This file contains hidden or 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
Common minimal format for sending just lat/long data | |
[ | |
{ | |
uuid: "550e8400-e29b-41d4-a716-446655440000", | |
date: "2010-04-30T16:50:00Z", | |
location: { | |
position: { | |
geojson: { "type": "Point", | |
"coordinates": [11.0, 61.0] } | |
} |
This file contains hidden or 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
module States | |
STATES = %w(cancelled declined passive active approved pending flagged complete) | |
attr_accessor :state # remove this if using an activerecord column | |
def self.included(mod) | |
STATES.each do |state| | |
up_state = state.upcase | |
mod.const_set(up_state, state) | |
mod.send(:define_method, state+'?') do |