WIP: Upgrade bundler deps.
parent
2872706db9
commit
059277ae85
2
Gemfile
2
Gemfile
|
@ -35,8 +35,6 @@ gem "redis", "~> 4.0"
|
|||
|
||||
group :development, :test do
|
||||
gem "thin"
|
||||
gem "capybara"
|
||||
# gem "deep-cover", "~> 0.4", require: false
|
||||
gem "codecov", require: false
|
||||
gem "simplecov"
|
||||
gem "database_cleaner"
|
||||
|
|
126
Gemfile.lock
126
Gemfile.lock
|
@ -7,25 +7,25 @@ GIT
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
actioncable (5.2.1)
|
||||
actionpack (= 5.2.1)
|
||||
actioncable (5.2.2)
|
||||
actionpack (= 5.2.2)
|
||||
nio4r (~> 2.0)
|
||||
websocket-driver (>= 0.6.1)
|
||||
actionmailer (5.2.1)
|
||||
actionpack (= 5.2.1)
|
||||
actionview (= 5.2.1)
|
||||
activejob (= 5.2.1)
|
||||
actionmailer (5.2.2)
|
||||
actionpack (= 5.2.2)
|
||||
actionview (= 5.2.2)
|
||||
activejob (= 5.2.2)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
actionpack (5.2.1)
|
||||
actionview (= 5.2.1)
|
||||
activesupport (= 5.2.1)
|
||||
actionpack (5.2.2)
|
||||
actionview (= 5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
rack (~> 2.0)
|
||||
rack-test (>= 0.6.3)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
actionview (5.2.1)
|
||||
activesupport (= 5.2.1)
|
||||
actionview (5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
builder (~> 3.1)
|
||||
erubi (~> 1.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
|
@ -35,20 +35,20 @@ GEM
|
|||
activemodel (>= 4.1, < 6)
|
||||
case_transform (>= 0.2)
|
||||
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
||||
activejob (5.2.1)
|
||||
activesupport (= 5.2.1)
|
||||
activejob (5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
globalid (>= 0.3.6)
|
||||
activemodel (5.2.1)
|
||||
activesupport (= 5.2.1)
|
||||
activerecord (5.2.1)
|
||||
activemodel (= 5.2.1)
|
||||
activesupport (= 5.2.1)
|
||||
activemodel (5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
activerecord (5.2.2)
|
||||
activemodel (= 5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
arel (>= 9.0)
|
||||
activestorage (5.2.1)
|
||||
actionpack (= 5.2.1)
|
||||
activerecord (= 5.2.1)
|
||||
activestorage (5.2.2)
|
||||
actionpack (= 5.2.2)
|
||||
activerecord (= 5.2.2)
|
||||
marcel (~> 0.3.1)
|
||||
activesupport (5.2.1)
|
||||
activesupport (5.2.2)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 0.7, < 2)
|
||||
minitest (~> 5.1)
|
||||
|
@ -56,21 +56,13 @@ GEM
|
|||
addressable (2.5.2)
|
||||
public_suffix (>= 2.0.2, < 4.0)
|
||||
amq-protocol (2.3.0)
|
||||
appsignal (2.7.2)
|
||||
appsignal (2.8.1)
|
||||
rack
|
||||
arel (9.0.0)
|
||||
bcrypt (3.1.12)
|
||||
builder (3.2.3)
|
||||
bunny (2.12.0)
|
||||
bunny (2.13.0)
|
||||
amq-protocol (~> 2.3, >= 2.3.0)
|
||||
capybara (3.11.0)
|
||||
addressable
|
||||
mini_mime (>= 0.1.3)
|
||||
nokogiri (~> 1.8)
|
||||
rack (>= 1.6.0)
|
||||
rack-test (>= 0.6.3)
|
||||
regexp_parser (~> 1.2)
|
||||
xpath (~> 3.2)
|
||||
case_transform (0.2)
|
||||
activesupport
|
||||
childprocess (0.9.0)
|
||||
|
@ -82,7 +74,7 @@ GEM
|
|||
simplecov
|
||||
url
|
||||
coderay (1.1.2)
|
||||
concurrent-ruby (1.1.3)
|
||||
concurrent-ruby (1.1.4)
|
||||
crass (1.0.4)
|
||||
daemons (1.2.6)
|
||||
database_cleaner (1.7.0)
|
||||
|
@ -103,8 +95,7 @@ GEM
|
|||
discard (1.0.0)
|
||||
activerecord (>= 4.2, < 6)
|
||||
docile (1.3.1)
|
||||
effin_utf8 (1.0)
|
||||
erubi (1.7.1)
|
||||
erubi (1.8.0)
|
||||
eventmachine (1.2.7)
|
||||
excon (0.62.0)
|
||||
factory_bot (4.11.1)
|
||||
|
@ -159,17 +150,17 @@ GEM
|
|||
multi_json (~> 1.11)
|
||||
os (>= 0.9, < 2.0)
|
||||
signet (~> 0.7)
|
||||
hashdiff (0.3.7)
|
||||
hashdiff (0.3.8)
|
||||
hashie (3.6.0)
|
||||
httpclient (2.8.3)
|
||||
i18n (1.1.1)
|
||||
i18n (1.4.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.1.0)
|
||||
jsonapi-renderer (0.2.0)
|
||||
jwt (2.1.0)
|
||||
launchy (2.4.3)
|
||||
addressable (~> 2.3)
|
||||
letter_opener (1.6.0)
|
||||
letter_opener (1.7.0)
|
||||
launchy (~> 2.2)
|
||||
lol_dba (2.1.5)
|
||||
actionpack (>= 3.0)
|
||||
|
@ -187,17 +178,17 @@ GEM
|
|||
mime-types (3.2.2)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2018.0812)
|
||||
mimemagic (0.3.2)
|
||||
mimemagic (0.3.3)
|
||||
mini_mime (1.0.1)
|
||||
mini_portile2 (2.3.0)
|
||||
mini_portile2 (2.4.0)
|
||||
minitest (5.11.3)
|
||||
multi_json (1.13.1)
|
||||
multipart-post (2.0.0)
|
||||
mutations (0.8.3)
|
||||
activesupport
|
||||
nio4r (2.3.1)
|
||||
nokogiri (1.8.5)
|
||||
mini_portile2 (~> 2.3.0)
|
||||
nokogiri (1.9.1)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
orm_adapter (0.5.0)
|
||||
os (1.0.0)
|
||||
paperclip (6.1.0)
|
||||
|
@ -206,7 +197,7 @@ GEM
|
|||
mime-types
|
||||
mimemagic (~> 0.3.0)
|
||||
terrapin (~> 0.6.0)
|
||||
passenger (5.3.7)
|
||||
passenger (6.0.0)
|
||||
rack
|
||||
rake (>= 0.8.1)
|
||||
pg (1.1.3)
|
||||
|
@ -215,11 +206,10 @@ GEM
|
|||
pry (0.12.2)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.9.0)
|
||||
pry-rails (0.3.7)
|
||||
pry-rails (0.3.9)
|
||||
pry (>= 0.10.4)
|
||||
public_suffix (3.0.3)
|
||||
rabbitmq_http_api_client (1.9.1)
|
||||
effin_utf8 (~> 1.0.0)
|
||||
rabbitmq_http_api_client (1.11.0)
|
||||
faraday (~> 0.13.0)
|
||||
faraday_middleware (~> 0.12.0)
|
||||
hashie (~> 3.5)
|
||||
|
@ -230,18 +220,18 @@ GEM
|
|||
rack-cors (1.0.2)
|
||||
rack-test (1.1.0)
|
||||
rack (>= 1.0, < 3)
|
||||
rails (5.2.1)
|
||||
actioncable (= 5.2.1)
|
||||
actionmailer (= 5.2.1)
|
||||
actionpack (= 5.2.1)
|
||||
actionview (= 5.2.1)
|
||||
activejob (= 5.2.1)
|
||||
activemodel (= 5.2.1)
|
||||
activerecord (= 5.2.1)
|
||||
activestorage (= 5.2.1)
|
||||
activesupport (= 5.2.1)
|
||||
rails (5.2.2)
|
||||
actioncable (= 5.2.2)
|
||||
actionmailer (= 5.2.2)
|
||||
actionpack (= 5.2.2)
|
||||
actionview (= 5.2.2)
|
||||
activejob (= 5.2.2)
|
||||
activemodel (= 5.2.2)
|
||||
activerecord (= 5.2.2)
|
||||
activestorage (= 5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
bundler (>= 1.3.0)
|
||||
railties (= 5.2.1)
|
||||
railties (= 5.2.2)
|
||||
sprockets-rails (>= 2.0.0)
|
||||
rails-dom-testing (2.0.3)
|
||||
activesupport (>= 4.2.0)
|
||||
|
@ -258,15 +248,14 @@ GEM
|
|||
rails_stdout_logging
|
||||
rails_serve_static_assets (0.0.5)
|
||||
rails_stdout_logging (0.0.5)
|
||||
railties (5.2.1)
|
||||
actionpack (= 5.2.1)
|
||||
activesupport (= 5.2.1)
|
||||
railties (5.2.2)
|
||||
actionpack (= 5.2.2)
|
||||
activesupport (= 5.2.2)
|
||||
method_source
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.19.0, < 2.0)
|
||||
rake (12.3.1)
|
||||
redis (4.0.3)
|
||||
regexp_parser (1.3.0)
|
||||
rake (12.3.2)
|
||||
redis (4.1.0)
|
||||
representable (3.0.4)
|
||||
declarative (< 0.1.0)
|
||||
declarative-option (< 0.2.0)
|
||||
|
@ -277,7 +266,7 @@ GEM
|
|||
actionpack (>= 4.2.0, < 5.3)
|
||||
railties (>= 4.2.0, < 5.3)
|
||||
retriable (3.1.2)
|
||||
rollbar (2.18.0)
|
||||
rollbar (2.18.2)
|
||||
multi_json
|
||||
rspec (3.8.0)
|
||||
rspec-core (~> 3.8.0)
|
||||
|
@ -319,9 +308,9 @@ GEM
|
|||
json (>= 1.8, < 3)
|
||||
simplecov-html (~> 0.10.0)
|
||||
simplecov-html (0.10.2)
|
||||
skylight (3.1.1)
|
||||
skylight-core (= 3.1.1)
|
||||
skylight-core (3.1.1)
|
||||
skylight (3.1.2)
|
||||
skylight-core (= 3.1.2)
|
||||
skylight-core (3.1.2)
|
||||
activesupport (>= 4.2.0)
|
||||
sprockets (3.7.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
|
@ -352,8 +341,6 @@ GEM
|
|||
websocket-driver (0.7.0)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.3)
|
||||
xpath (3.2.0)
|
||||
nokogiri (~> 1.8)
|
||||
zero_downtime_migrations (0.0.7)
|
||||
activerecord
|
||||
|
||||
|
@ -364,7 +351,6 @@ DEPENDENCIES
|
|||
active_model_serializers
|
||||
appsignal
|
||||
bunny
|
||||
capybara
|
||||
climate_control
|
||||
codecov
|
||||
database_cleaner
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
# Farmbot Device models all data related to an actual FarmBot in the real world.
|
||||
class Device < ApplicationRecord
|
||||
DEFAULT_MAX_LOGS = 100
|
||||
DEFAULT_MAX_IMAGES = 100
|
||||
DEFAULT_MAX_CONFIGS = 100
|
||||
DEFAULT_MAX_IMAGES = 100
|
||||
DEFAULT_MAX_LOGS = 100
|
||||
|
||||
TIMEZONES = TZInfo::Timezone.all_identifiers
|
||||
BAD_TZ = "%{value} is not a valid timezone"
|
||||
THROTTLE_ON = "Device is sending too many logs (%s). " \
|
||||
"Suspending log storage and display until %s."
|
||||
THROTTLE_OFF = "Cooldown period has ended. "\
|
||||
"Resuming log storage."
|
||||
CACHE_KEY = "devices.%s"
|
||||
TIMEZONES = TZInfo::Timezone.all_identifiers
|
||||
BAD_TZ = "%{value} is not a valid timezone"
|
||||
THROTTLE_ON = "Device is sending too many logs (%s). " \
|
||||
"Suspending log storage and display until %s."
|
||||
THROTTLE_OFF = "Cooldown period has ended. "\
|
||||
"Resuming log storage."
|
||||
CACHE_KEY = "devices.%s"
|
||||
|
||||
has_many :farmware_envs, dependent: :destroy
|
||||
has_many :farm_events, dependent: :destroy
|
||||
|
@ -31,6 +31,7 @@ class Device < ApplicationRecord
|
|||
has_many :webcam_feeds, dependent: :destroy
|
||||
has_many :diagnostic_dumps, dependent: :destroy
|
||||
has_one :fbos_config, dependent: :destroy
|
||||
has_one :device_serial_number, dependent: :destroy
|
||||
has_many :in_use_tools
|
||||
has_many :in_use_points
|
||||
has_many :users
|
||||
|
|
|
@ -1,4 +1,19 @@
|
|||
# An API backup of user options for Farmbot OS.
|
||||
class FbosConfig < ApplicationRecord
|
||||
belongs_to :device
|
||||
after_save :maybe_sync_nerves, on: [:create, :update]
|
||||
|
||||
NERVES_FIELD = "update_channel"
|
||||
|
||||
def nerves_info_changed?
|
||||
the_changes.keys.include?(NERVES_FIELD)
|
||||
end
|
||||
|
||||
def sync_nerves
|
||||
binding.pry
|
||||
end
|
||||
|
||||
def maybe_sync_nerves
|
||||
sync_nerves if nerves_info_changed?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe FbosConfig do
|
||||
let(:device) { FactoryBot.create(:device) }
|
||||
it 'triggers callbacks' do
|
||||
config = FbosConfig.create!(device: device)
|
||||
config.update_attributes!(update_channel: "beta")
|
||||
binding.pry
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue