Merge branch 'szzh' into develop

This commit is contained in:
sw 2015-04-15 11:28:02 +08:00
commit 9079eaa4f9
4 changed files with 14 additions and 5 deletions

View File

@ -15,13 +15,13 @@ module Mobile
when :img_url
url_to_avatar(u)
when :gender
u.user_extensions.gender.nil? ? 0 : u.user_extensions.gender
u.nil? || u.user_extensions.nil? || u.user_extensions.gender.nil? ? 0 : u.user_extensions.gender
when :work_unit
get_user_work_unit u
when :location
get_user_location u
when :brief_introduction
u.user_extensions.brief_introduction
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.brief_introduction
end
end
end

View File

@ -345,7 +345,7 @@ class CoursesService
def course_dynamic(params,current_user)
@user = User.find(params[:id])
if !current_user.admin? && !@user.active?
if current_user.nil? && !current_user.admin? && !@user.active?
raise '404'
return
end

View File

@ -0,0 +1,9 @@
class ChangeFileDigests < ActiveRecord::Migration
def up
change_column :zip_packs, :file_digests, :text
end
def down
change_column :zip_packs, :file_digests, :string
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150402015402) do
ActiveRecord::Schema.define(:version => 20150415032102) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -1458,7 +1458,7 @@ ActiveRecord::Schema.define(:version => 20150402015402) do
t.string "file_path"
t.integer "pack_times", :default => 1
t.integer "pack_size", :default => 0
t.string "file_digests"
t.text "file_digests"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end