Class: INat::Entity::Project

Inherits:
Data::Entity show all
Extended by:
BySLUG
Includes:
Data::Types, INat::Entity
Defined in:
lib/inat/data/entity/project.rb,
lib/inat/data/entity/projectadmin.rb,
lib/inat/data/entity/projectobservationrule.rb

Fields collapse

Attributes inherited from Data::Entity

#id

Instance Method Summary collapse

Methods included from BySLUG

by_slug

Methods included from Data::Types

#radius, radius, #sector, sector

Methods inherited from Data::Entity

by_id, #complete?, ddl, fetch, from_db_rows, #get, #init, #initialize, load, load_file, parse, read, #save, #to_db, #update

Methods included from App::Logger::DSL

#debug, debug, echo, #echo, error, #error, #info, info, log, #log, #warning, warning

Methods inherited from Data::Model

DDL, api_limit, api_part, api_path, backs, block, field, fields, has_path?, has_table?, #ignore, #initialize, links, #post_update, #process?, #saved?, table, #to_h, #update

Constructor Details

This class inherits a constructor from INat::Data::Entity

Instance Attribute Details

#adminsArray<item_type: ProjectAdmin>

Returns the admins field.

Returns:



60
# File 'lib/inat/data/entity/project.rb', line 60

backs :admins, item_type: ProjectAdmin, owned: true

TODO: сделать тип

Returns:

  • (type: String)

    the banner_color field



48
# File 'lib/inat/data/entity/project.rb', line 48

field :banner_color, type: String

#created_attype: Time

Returns the created_at field.

Returns:

  • (type: Time)

    the created_at field



39
# File 'lib/inat/data/entity/project.rb', line 39

field :created_at, type: Time

#descriptiontype: String

Returns the description field.

Returns:

  • (type: String)

    the description field



36
# File 'lib/inat/data/entity/project.rb', line 36

field :description, type: String

#excluded_placesArray<item_type: Place>

Returns the excluded_places field.

Returns:

  • (Array<item_type: Place>)

    the excluded_places field



70
# File 'lib/inat/data/entity/project.rb', line 70

links :excluded_places, item_type: Place, ids_field: :excluded_places_ids, table_name: :project_rule_excluded_places, owned: false

#excluded_taxaArray<item_type: Taxon>

Returns the excluded_taxa field.

Returns:

  • (Array<item_type: Taxon>)

    the excluded_taxa field



68
# File 'lib/inat/data/entity/project.rb', line 68

links :excluded_taxa, item_type: Taxon, ids_field: :excluded_taxon_ids, table_name: :project_rule_excluded_taxa, owned: false

#flagsArray<item_type: Flag>

Returns the flags field.

Returns:

  • (Array<item_type: Flag>)

    the flags field



63
# File 'lib/inat/data/entity/project.rb', line 63

links :flags, item_type: Flag, index: true

#header_image_containtype: Boolean

Returns the header_image_contain field.

Returns:

  • (type: Boolean)

    the header_image_contain field



47
# File 'lib/inat/data/entity/project.rb', line 47

field :header_image_contain, type: Boolean

#header_image_file_nametype: String

Returns the header_image_file_name field.

Returns:

  • (type: String)

    the header_image_file_name field



46
# File 'lib/inat/data/entity/project.rb', line 46

field :header_image_file_name, type: String

#header_image_urltype: URI

Returns the header_image_url field.

Returns:

  • (type: URI)

    the header_image_url field



45
# File 'lib/inat/data/entity/project.rb', line 45

field :header_image_url, type: URI

#hide_titletype: Boolean

Returns the hide_title field.

Returns:

  • (type: Boolean)

    the hide_title field



49
# File 'lib/inat/data/entity/project.rb', line 49

field :hide_title, type: Boolean

#icontype: URI

Returns the icon field.

Returns:

  • (type: URI)

    the icon field



43
# File 'lib/inat/data/entity/project.rb', line 43

field :icon, type: URI

#icon_file_nametype: String

Returns the icon_file_name field.

Returns:

  • (type: String)

    the icon_file_name field



44
# File 'lib/inat/data/entity/project.rb', line 44

field :icon_file_name, type: String

#included_placesArray<item_type: Place>

Returns the included_places field.

Returns:

  • (Array<item_type: Place>)

    the included_places field



69
# File 'lib/inat/data/entity/project.rb', line 69

links :included_places, item_type: Place, ids_field: :included_place_ids, table_name: :project_rule_places, owned: false

#included_taxaArray<item_type: Taxon>

Returns the included_taxa field.

Returns:

  • (Array<item_type: Taxon>)

    the included_taxa field



67
# File 'lib/inat/data/entity/project.rb', line 67

links :included_taxa, item_type: Taxon, ids_field: :included_taxon_ids, table_name: :project_rule_taxa, owned: false

#is_umbrellatype: Boolean

Returns the is_umbrella field.

Returns:

  • (type: Boolean)

    the is_umbrella field



38
# File 'lib/inat/data/entity/project.rb', line 38

field :is_umbrella, type: Boolean, index: true

#locationtype: Location

Returns the location field.

Returns:

  • (type: Location)

    the location field



51
# File 'lib/inat/data/entity/project.rb', line 51

field :location, type: Location

#observation_requirements_updated_attype: Time

Returns the observation_requirements_updated_at field.

Returns:

  • (type: Time)

    the observation_requirements_updated_at field



41
# File 'lib/inat/data/entity/project.rb', line 41

field :observation_requirements_updated_at, type: Time

#observationsArray<item_type: Observation>

Returns the observations field.

Returns:

  • (Array<item_type: Observation>)

    the observations field



72
# File 'lib/inat/data/entity/project.rb', line 72

links :observations, item_type: Observation, table_name: :project_observations, owned: false

#placetype: Place

Returns the place field.

Returns:

  • (type: Place)

    the place field



53
# File 'lib/inat/data/entity/project.rb', line 53

field :place, type: Place, index: true

#prefers_user_trusttype: Boolean

Returns the prefers_user_trust field.

Returns:

  • (type: Boolean)

    the prefers_user_trust field



42
# File 'lib/inat/data/entity/project.rb', line 42

field :prefers_user_trust, type: Boolean

#project_observation_rulesArray<item_type: ProjectObservationRule>

Returns the project_observation_rules field.

Returns:



61
# File 'lib/inat/data/entity/project.rb', line 61

backs :project_observation_rules, item_type: ProjectObservationRule, owned: true

#project_typetype: ProjectType

Returns the project_type field.

Returns:



37
# File 'lib/inat/data/entity/project.rb', line 37

field :project_type, type: ProjectType, index: true

#slugtype: Symbol

Returns the slug field.

Returns:

  • (type: Symbol)

    the slug field



34
# File 'lib/inat/data/entity/project.rb', line 34

field :slug, type: Symbol, index: true

#subprojectsArray<item_type: Project>

Returns the subprojects field.

Returns:

  • (Array<item_type: Project>)

    the subprojects field



65
# File 'lib/inat/data/entity/project.rb', line 65

links :subprojects, item_type: Project, table_name: :project_children, link_field: :child_id, owned: false

#titletype: String

Returns the title field.

Returns:

  • (type: String)

    the title field



35
# File 'lib/inat/data/entity/project.rb', line 35

field :title, type: String, index: true, required: true

#updated_attype: Time

Returns the updated_at field.

Returns:

  • (type: Time)

    the updated_at field



40
# File 'lib/inat/data/entity/project.rb', line 40

field :updated_at, type: Time

#usertype: User

Returns the user field.

Returns:

  • (type: User)

    the user field



50
# File 'lib/inat/data/entity/project.rb', line 50

field :user, type: User, index: true

Instance Method Details

#to_sObject



96
97
98
# File 'lib/inat/data/entity/project.rb', line 96

def to_s
  "<a href=\"https://www.inaturalist.org/projects/#{ id }\"><i class=\"fa fa-briefcase\"></i>  #{ title }</a>"
end