mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
finalize planet relations
This commit is contained in:
parent
9f000bb7c0
commit
6969397b01
@ -4,10 +4,24 @@ class PlanetsController < ContentController
|
||||
|
||||
def content_param_list
|
||||
[
|
||||
:name, :description, :size, :surface, :landmarks, :climate, :weather, :water_content, :natural_resources, :length_of_day, :length_of_night, :calendar_system, :population, :moons, :orbit, :visible_constellations, :first_inhabitants_story, :world_history, :public_notes, :private_notes, :privacy, :universe_id
|
||||
:name, :description, :size, :surface, :landmarks, :climate, :weather,
|
||||
:water_content, :natural_resources, :length_of_day, :length_of_night,
|
||||
:calendar_system, :population, :moons, :orbit, :visible_constellations,
|
||||
:first_inhabitants_story, :world_history, :public_notes, :private_notes,
|
||||
:privacy, :universe_id
|
||||
] + [ #<relations>
|
||||
|
||||
planet_countries_attributes: [:id, :country_id, :_destroy],
|
||||
planet_locations_attributes: [:id, :location_id, :_destroy],
|
||||
planet_landmarks_attributes: [:id, :landmark_id, :_destroy],
|
||||
planet_races_attributes: [:id, :race_id, :_destroy],
|
||||
planet_floras_attributes: [:id, :flora_id, :_destroy],
|
||||
planet_creatures_attributes: [:id, :creature_id, :_destroy],
|
||||
planet_religions_attributes: [:id, :religion_id, :_destroy],
|
||||
planet_deities_attributes: [:id, :deity_id, :_destroy],
|
||||
planet_groups_attributes: [:id, :group_id, :_destroy],
|
||||
planet_languages_attributes: [:id, :language_id, :_destroy],
|
||||
planet_towns_attributes: [:id, :town_id, :_destroy],
|
||||
planet_nearby_planets_attributes: [:id, :nearby_planet_id, :_destroy]
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
class PlanetNearbyPlanet < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
belongs_to :planet
|
||||
belongs_to :nearby_planet, class_name: Planet.name
|
||||
end
|
||||
|
||||
@ -15,8 +15,6 @@
|
||||
:label: Size
|
||||
- :name: surface
|
||||
:label: Surface
|
||||
- :name: landmarks
|
||||
:label: Landmarks
|
||||
- :name: climate
|
||||
:label: Climate
|
||||
- :name: weather
|
||||
@ -25,6 +23,12 @@
|
||||
:label: Water Content
|
||||
- :name: natural_resources
|
||||
:label: Natural Resources
|
||||
- :name: landmarks
|
||||
:label: Landmarks
|
||||
- :name: locations
|
||||
:label: Locations
|
||||
- :name: countries
|
||||
:label: Countries
|
||||
:time:
|
||||
:label: Time
|
||||
:icon: hourglass_empty
|
||||
@ -41,6 +45,22 @@
|
||||
:attributes:
|
||||
- :name: population
|
||||
:label: Population
|
||||
- :name: races
|
||||
:label: Races
|
||||
- :name: floras
|
||||
:label: Flora
|
||||
- :name: creatures
|
||||
:label: Creatures
|
||||
- :name: religions
|
||||
:label: Religions
|
||||
- :name: deities
|
||||
:label: Deities
|
||||
- :name: groups
|
||||
:label: Groups
|
||||
- :name: languages
|
||||
:label: Languages
|
||||
- :name: towns
|
||||
:label: Towns
|
||||
:astral:
|
||||
:label: Astral
|
||||
:icon: star_border
|
||||
@ -51,6 +71,8 @@
|
||||
:label: Orbit
|
||||
- :name: visible_constellations
|
||||
:label: Visible Constellations
|
||||
- :name: nearby_planets
|
||||
:label: Nearby planets
|
||||
:history:
|
||||
:label: History
|
||||
:icon: timeline
|
||||
|
||||
@ -16,7 +16,7 @@ class GroupLeadership < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
|
||||
belongs_to :group
|
||||
belongs_to :leader, class_name: 'Character'
|
||||
belongs_to :leader, class_name: Character.name
|
||||
end
|
||||
|
||||
## Add attributes to whitelist in groups_controller.rb
|
||||
|
||||
Loading…
Reference in New Issue
Block a user