Only confirmed events in JSON API
This commit is contained in:
parent
08637503e5
commit
7f3c8a65de
2 changed files with 3 additions and 1 deletions
|
|
@ -6,6 +6,6 @@ class Api::V1::EventsController < Api::BaseController
|
||||||
unless params[:conference_id].blank?
|
unless params[:conference_id].blank?
|
||||||
events = events.where("conferences.guid" => params[:conference_id])
|
events = events.where("conferences.guid" => params[:conference_id])
|
||||||
end
|
end
|
||||||
respond_with events
|
respond_with events.confirmed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@ class Event < ActiveRecord::Base
|
||||||
validates :title, :presence => true
|
validates :title, :presence => true
|
||||||
validates :abstract, :presence => true
|
validates :abstract, :presence => true
|
||||||
|
|
||||||
|
scope :confirmed, where(:state => "confirmed")
|
||||||
|
|
||||||
state_machine :initial => :new do
|
state_machine :initial => :new do
|
||||||
state :new
|
state :new
|
||||||
state :review
|
state :review
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue