Commit a0f74c90 by Ivan Lan

Merge branch 'lan/update_warning_district_ohm_index' into 'master'

Lan/update warning district ohm index See merge request !16
parents b3b6e42c 939065e5
......@@ -11,8 +11,8 @@ module WeatherModel
unit: :string
},
options: {
index: [:publishtime, :unit],
expire: 11 * 24 * 60 * 60,
index: [:publishtime, :level, :unit],
expire: 2 * 24 * 60 * 60,
unique: nil,
belongs_to: nil,
has_many: nil,
......
......@@ -33,15 +33,15 @@ RSpec.describe WeatherModel do
end
it 'Test factory_girl' do
expect(@obj.class).to eq(Forecast::CityForecast), 'factory_girl 生成成功'
expect(@obj.class).to eq(::WeatherModel::Forecast::CityForecast), 'factory_girl 生成成功'
end
end
it 'Forecast' do
@expire = 1
mysql = Forecast::CityForecast
ohm = ohm
mysql = ::WeatherModel::Forecast::CityForecast
ohm = ::WeatherModel::Forecast::CityForecast::Ohm
ohm.expire @expire
mysql_obj = mysql.create({
datetime: '2017-05-16',
......@@ -66,7 +66,7 @@ RSpec.describe WeatherModel do
end
it 'aqi_forecast' do
@aqi_forecast = Aqi::AqiForecast.create(
@aqi_forecast = ::WeatherModel::Aqi::AqiForecast.create(
datetime: Time.now,
prompt: '',
list: [
......@@ -83,8 +83,8 @@ RSpec.describe WeatherModel do
},
]
)
expect(Aqi::AqiForecast.all.first.list.class).to eq(Array), 'Mysql json_column 正常'
expect(Aqi::AqiForecast::Ohm.all.first.list.class).to eq(Array), 'Ohm json_column 正常'
expect(::WeatherModel::Aqi::AqiForecast.all.first.list.class).to eq(Array), 'Mysql json_column 正常'
expect(::WeatherModel::Aqi::AqiForecast::Ohm.all.first.list.class).to eq(Array), 'Ohm json_column 正常'
end
describe 'test Ohm # to_h' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment