Fix summon update_uncap_level (#119)
* Remove ap call * Fix remix render method * Downcase username on db end There was a bug where users with capital letters in their name could not access their profiles after we tried to make things case insensitive. * Remove ap call and unused code * Add granblue.team to cors This works now! * Implement all-entity search to support tagging objects (#117) * Add table for multisearch * Add new route for searching all entities * Make models multisearchable We're going to start with Character, Summon, Weapon and Jobs * Add method to Search controller This will search with trigram first, and then if there aren't enough results, search with prefixed text search * Add support for Japanese all-entity search * Update grid_summons_controller.rb Set the proper uncap level for transcended summons
This commit is contained in:
parent
39a0d33bee
commit
6d51033d0e
1 changed files with 7 additions and 5 deletions
|
|
@ -32,16 +32,18 @@ module Api
|
||||||
|
|
||||||
def update_uncap_level
|
def update_uncap_level
|
||||||
summon = @summon.summon
|
summon = @summon.summon
|
||||||
max_uncap_level = if summon.flb && !summon.ulb
|
max_uncap_level = if summon.flb && !summon.ulb && !summon.xlb
|
||||||
4
|
4
|
||||||
elsif summon.ulb
|
elsif summon.ulb && !summon.xlb
|
||||||
5
|
5
|
||||||
|
elsif summon.xlb
|
||||||
|
6
|
||||||
else
|
else
|
||||||
3
|
3
|
||||||
end
|
end
|
||||||
|
|
||||||
greater_than_max_uncap = summon_params[:uncap_level].to_i > max_uncap_level
|
greater_than_max_uncap = summon_params[:uncap_level].to_i > max_uncap_level
|
||||||
can_be_transcended = summon.xlb && summon_params[:transcendence_step] && summon_params[:transcendence_step]&.to_i.positive?
|
can_be_transcended = summon.xlb && summon_params[:transcendence_step] && summon_params[:transcendence_step]&.to_i&.positive?
|
||||||
|
|
||||||
uncap_level = if greater_than_max_uncap || can_be_transcended
|
uncap_level = if greater_than_max_uncap || can_be_transcended
|
||||||
max_uncap_level
|
max_uncap_level
|
||||||
|
|
@ -130,8 +132,8 @@ module Api
|
||||||
|
|
||||||
def render_grid_summon_view(grid_summon, conflict_position = nil)
|
def render_grid_summon_view(grid_summon, conflict_position = nil)
|
||||||
GridSummonBlueprint.render(grid_summon, view: :nested,
|
GridSummonBlueprint.render(grid_summon, view: :nested,
|
||||||
root: :grid_summon,
|
root: :grid_summon,
|
||||||
meta: { replaced: conflict_position })
|
meta: { replaced: conflict_position })
|
||||||
end
|
end
|
||||||
|
|
||||||
def authorize
|
def authorize
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue