Created
April 10, 2013 16:11
-
-
Save ansix/5356037 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Festival < ActiveRecord::Base | |
attr_accessible :name, :client_id | |
belongs_to :client | |
has_many :covers | |
has_many :photos | |
def as_json(opts = {}) | |
if !covers.empty? | |
opts = opts.merge({ | |
:except => [:created_at, :updated_at], | |
:include => { | |
:covers => { | |
:methods => [:image_url, :thumbnail_url], | |
:except => [:created_at, #:updated_at, | |
:main_text_block_id, :left_text_bar_id, | |
:first_left_text_block_id, :second_left_text_block_id, :third_left_text_block_id, | |
:first_right_text_block_id] | |
} | |
} | |
}) | |
super(opts) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment