lib/smartfm/models/list.rb in smartfm-1.0.0 vs lib/smartfm/models/list.rb in smartfm-1.0.1
- old
+ new
@@ -1,8 +1,8 @@
class Smartfm::List < Smartfm::Base
ATTRIBUTES = [:id, :title, :description, :icon, :square_icon, :item_count, :user_count, :iknow, :dictation, :brainspeed,
- :language, :translation_language, :list_type, :transcript, :embed, :tags, :media_entry,
+ :language, :translation_language, :item_type, :transcript, :embed, :tags, :media_entry,
:attribution_license_id, :items, :sentences, :user]
READONLY_ATTRIBUTES = [:id, :icon, :item_count, :user_count, :iknow, :dictation, :brainspeed, :user]
attr_accessor *(ATTRIBUTES - READONLY_ATTRIBUTES)
attr_reader *READONLY_ATTRIBUTES
@@ -48,11 +48,11 @@
common_settings = {:list_id => @id, :lang => @translation_language}
@iknow = Application.new(common_settings.merge(:iknow => params[:iknow]))
@dictation = Application.new(common_settings.merge(:dictation => params[:dictation]))
@brainspeed = Application.new(common_settings.merge(:brainspeed => params[:brainspeed]))
end
- @list_type = params[:list_type] # for list creation
+ @item_type = params[:item_type] # for list creation
@transcript = params[:transcript] # for list creation
@embed = params[:embed] # for list creation
@tags = params[:tags] # for list creation
@media_entry = params[:media_entry] # for list creation
@attribution_license_id = params[:attribution_license_id] # for list creation
@@ -88,13 +88,10 @@
'list[description]' => self.description,
'list[language]' => self.language || 'en',
'list[translation_language]' => self.translation_language || 'ja'
}
# Optional attributes
- if self.list_type
- post_data['list[type]'] = self.list_type
- end
- [:transcript, :embed, :tags, :media_entry, :author, :author_url, :attribution_license_id ].each do |key|
+ [:transcript, :embed, :tags, :item_type].each do |key|
if self.send("#{key}")
post_data["list[#{key}]"] = self.send("#{key}")
end
end
post_data
\ No newline at end of file