module Tools::WithActions

Métodos comunes para los contenidos que tie nen acciones: áreas y políticos. Las instancias del modelo que incuye este módulo tienen que tener definido el método tag_name_es

Public Instance Methods

albums() click to toggle source

Álbumes de un área: son los álbumes que tienen el tag del área

# File app/models/tools/with_actions.rb, line 59
def albums
  Album.published.with_photos.tagged_with(self.tag_name_es)
end
albums_count() click to toggle source
# File app/models/tools/with_actions.rb, line 63
def albums_count
  self.albums.count('distinct albums.id')
end
answers() click to toggle source
# File app/models/tools/with_actions.rb, line 97
def answers
  Comment.official.approved.tagged_with(self.tag_name_es)
end
approved_and_published_proposals() click to toggle source

Propuestas del área: son las propuestas que comparten tags con el área

# File app/models/tools/with_actions.rb, line 77
def approved_and_published_proposals
  Proposal.approved.published.tagged_with(self.tag_name_es) #translated???
end
comments() click to toggle source
# File app/models/tools/with_actions.rb, line 93
def comments
  Comment.approved.tagged_with(self.tag_name_es)
end
debates() click to toggle source
# File app/models/tools/with_actions.rb, line 89
def debates
  Debate.published.translated.tagged_with(self.tag_name_es)
end
events() click to toggle source

Eventos del área: son los eventos que comparten tags con el área

# File app/models/tools/with_actions.rb, line 41
def events
  Event.published.translated.tagged_with(self.tag_name_es)
end
events_count() click to toggle source
# File app/models/tools/with_actions.rb, line 45
def events_count
  self.events.count('distinct documents.id')
end
news() click to toggle source

Noticias que comparten tags con el modelo

# File app/models/tools/with_actions.rb, line 28
def news
  News.published.translated.tagged_with(self.tag_name_es)
end
news_count() click to toggle source
# File app/models/tools/with_actions.rb, line 32
def news_count
  self.news.count('distinct documents.id')
end
photos() click to toggle source

Fotos de un área: son las fotos que tienen el tag del área

# File app/models/tools/with_actions.rb, line 68
def photos
  Photo.published.tagged_with(self.tag_name_es)
end
photos_count() click to toggle source
# File app/models/tools/with_actions.rb, line 72
def photos_count
  self.photos.count('distinct photos.id')
end
proposals_count() click to toggle source
# File app/models/tools/with_actions.rb, line 85
def proposals_count
  self.approved_and_published_proposals.count('distinct contributions.id')
end
published_debates() click to toggle source
# File app/models/tools/with_actions.rb, line 81
def published_debates
  Debate.published.tagged_with(self.tag_name_es) #translated???
end
videos() click to toggle source

Vídeos del área: son los vídeos que tienen el tag del área

# File app/models/tools/with_actions.rb, line 50
def videos
  Video.published.translated.tagged_with(self.tag_name_es)
end
videos_count() click to toggle source
# File app/models/tools/with_actions.rb, line 54
def videos_count
  self.videos.count('distinct videos.id')
end