dm_core 4.2.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +22 -0
- data/README.md +25 -0
- data/Rakefile +34 -0
- data/app/assets/images/dm_core/draft_menu_bg.png +0 -0
- data/app/assets/images/dm_core/expand.png +0 -0
- data/app/assets/images/dm_core/flags/ad.gif +0 -0
- data/app/assets/images/dm_core/flags/ae.gif +0 -0
- data/app/assets/images/dm_core/flags/af.gif +0 -0
- data/app/assets/images/dm_core/flags/ag.gif +0 -0
- data/app/assets/images/dm_core/flags/ai.gif +0 -0
- data/app/assets/images/dm_core/flags/al.gif +0 -0
- data/app/assets/images/dm_core/flags/am.gif +0 -0
- data/app/assets/images/dm_core/flags/an.gif +0 -0
- data/app/assets/images/dm_core/flags/ao.gif +0 -0
- data/app/assets/images/dm_core/flags/ar.gif +0 -0
- data/app/assets/images/dm_core/flags/as.gif +0 -0
- data/app/assets/images/dm_core/flags/at.gif +0 -0
- data/app/assets/images/dm_core/flags/au.gif +0 -0
- data/app/assets/images/dm_core/flags/aw.gif +0 -0
- data/app/assets/images/dm_core/flags/ax.gif +0 -0
- data/app/assets/images/dm_core/flags/az.gif +0 -0
- data/app/assets/images/dm_core/flags/ba.gif +0 -0
- data/app/assets/images/dm_core/flags/bb.gif +0 -0
- data/app/assets/images/dm_core/flags/bd.gif +0 -0
- data/app/assets/images/dm_core/flags/be.gif +0 -0
- data/app/assets/images/dm_core/flags/bf.gif +0 -0
- data/app/assets/images/dm_core/flags/bg.gif +0 -0
- data/app/assets/images/dm_core/flags/bh.gif +0 -0
- data/app/assets/images/dm_core/flags/bi.gif +0 -0
- data/app/assets/images/dm_core/flags/bj.gif +0 -0
- data/app/assets/images/dm_core/flags/bm.gif +0 -0
- data/app/assets/images/dm_core/flags/bn.gif +0 -0
- data/app/assets/images/dm_core/flags/bo.gif +0 -0
- data/app/assets/images/dm_core/flags/br.gif +0 -0
- data/app/assets/images/dm_core/flags/bs.gif +0 -0
- data/app/assets/images/dm_core/flags/bt.gif +0 -0
- data/app/assets/images/dm_core/flags/bv.gif +0 -0
- data/app/assets/images/dm_core/flags/bw.gif +0 -0
- data/app/assets/images/dm_core/flags/by.gif +0 -0
- data/app/assets/images/dm_core/flags/bz.gif +0 -0
- data/app/assets/images/dm_core/flags/ca.gif +0 -0
- data/app/assets/images/dm_core/flags/cc.gif +0 -0
- data/app/assets/images/dm_core/flags/cd.gif +0 -0
- data/app/assets/images/dm_core/flags/cf.gif +0 -0
- data/app/assets/images/dm_core/flags/cg.gif +0 -0
- data/app/assets/images/dm_core/flags/ch.gif +0 -0
- data/app/assets/images/dm_core/flags/ci.gif +0 -0
- data/app/assets/images/dm_core/flags/ck.gif +0 -0
- data/app/assets/images/dm_core/flags/cl.gif +0 -0
- data/app/assets/images/dm_core/flags/cm.gif +0 -0
- data/app/assets/images/dm_core/flags/cn.gif +0 -0
- data/app/assets/images/dm_core/flags/co.gif +0 -0
- data/app/assets/images/dm_core/flags/cr.gif +0 -0
- data/app/assets/images/dm_core/flags/cs.gif +0 -0
- data/app/assets/images/dm_core/flags/cu.gif +0 -0
- data/app/assets/images/dm_core/flags/cv.gif +0 -0
- data/app/assets/images/dm_core/flags/cx.gif +0 -0
- data/app/assets/images/dm_core/flags/cy.gif +0 -0
- data/app/assets/images/dm_core/flags/cz.gif +0 -0
- data/app/assets/images/dm_core/flags/de.gif +0 -0
- data/app/assets/images/dm_core/flags/dj.gif +0 -0
- data/app/assets/images/dm_core/flags/dk.gif +0 -0
- data/app/assets/images/dm_core/flags/dm.gif +0 -0
- data/app/assets/images/dm_core/flags/do.gif +0 -0
- data/app/assets/images/dm_core/flags/dz.gif +0 -0
- data/app/assets/images/dm_core/flags/ec.gif +0 -0
- data/app/assets/images/dm_core/flags/ee.gif +0 -0
- data/app/assets/images/dm_core/flags/eg.gif +0 -0
- data/app/assets/images/dm_core/flags/eh.gif +0 -0
- data/app/assets/images/dm_core/flags/en.gif +0 -0
- data/app/assets/images/dm_core/flags/england.gif +0 -0
- data/app/assets/images/dm_core/flags/er.gif +0 -0
- data/app/assets/images/dm_core/flags/es.gif +0 -0
- data/app/assets/images/dm_core/flags/et.gif +0 -0
- data/app/assets/images/dm_core/flags/fam.gif +0 -0
- data/app/assets/images/dm_core/flags/fi.gif +0 -0
- data/app/assets/images/dm_core/flags/fj.gif +0 -0
- data/app/assets/images/dm_core/flags/fk.gif +0 -0
- data/app/assets/images/dm_core/flags/fm.gif +0 -0
- data/app/assets/images/dm_core/flags/fo.gif +0 -0
- data/app/assets/images/dm_core/flags/fr.gif +0 -0
- data/app/assets/images/dm_core/flags/ga.gif +0 -0
- data/app/assets/images/dm_core/flags/gb.gif +0 -0
- data/app/assets/images/dm_core/flags/gd.gif +0 -0
- data/app/assets/images/dm_core/flags/ge.gif +0 -0
- data/app/assets/images/dm_core/flags/gh.gif +0 -0
- data/app/assets/images/dm_core/flags/gi.gif +0 -0
- data/app/assets/images/dm_core/flags/gl.gif +0 -0
- data/app/assets/images/dm_core/flags/gm.gif +0 -0
- data/app/assets/images/dm_core/flags/gn.gif +0 -0
- data/app/assets/images/dm_core/flags/gp.gif +0 -0
- data/app/assets/images/dm_core/flags/gq.gif +0 -0
- data/app/assets/images/dm_core/flags/gr.gif +0 -0
- data/app/assets/images/dm_core/flags/gs.gif +0 -0
- data/app/assets/images/dm_core/flags/gt.gif +0 -0
- data/app/assets/images/dm_core/flags/gu.gif +0 -0
- data/app/assets/images/dm_core/flags/gw.gif +0 -0
- data/app/assets/images/dm_core/flags/gy.gif +0 -0
- data/app/assets/images/dm_core/flags/hk.gif +0 -0
- data/app/assets/images/dm_core/flags/hn.gif +0 -0
- data/app/assets/images/dm_core/flags/hr.gif +0 -0
- data/app/assets/images/dm_core/flags/ht.gif +0 -0
- data/app/assets/images/dm_core/flags/hu.gif +0 -0
- data/app/assets/images/dm_core/flags/id.gif +0 -0
- data/app/assets/images/dm_core/flags/ie.gif +0 -0
- data/app/assets/images/dm_core/flags/il.gif +0 -0
- data/app/assets/images/dm_core/flags/in.gif +0 -0
- data/app/assets/images/dm_core/flags/io.gif +0 -0
- data/app/assets/images/dm_core/flags/iq.gif +0 -0
- data/app/assets/images/dm_core/flags/ir.gif +0 -0
- data/app/assets/images/dm_core/flags/is.gif +0 -0
- data/app/assets/images/dm_core/flags/it.gif +0 -0
- data/app/assets/images/dm_core/flags/ja.gif +0 -0
- data/app/assets/images/dm_core/flags/jm.gif +0 -0
- data/app/assets/images/dm_core/flags/jo.gif +0 -0
- data/app/assets/images/dm_core/flags/ke.gif +0 -0
- data/app/assets/images/dm_core/flags/kg.gif +0 -0
- data/app/assets/images/dm_core/flags/kh.gif +0 -0
- data/app/assets/images/dm_core/flags/ki.gif +0 -0
- data/app/assets/images/dm_core/flags/km.gif +0 -0
- data/app/assets/images/dm_core/flags/kn.gif +0 -0
- data/app/assets/images/dm_core/flags/kp.gif +0 -0
- data/app/assets/images/dm_core/flags/kr.gif +0 -0
- data/app/assets/images/dm_core/flags/kw.gif +0 -0
- data/app/assets/images/dm_core/flags/ky.gif +0 -0
- data/app/assets/images/dm_core/flags/kz.gif +0 -0
- data/app/assets/images/dm_core/flags/la.gif +0 -0
- data/app/assets/images/dm_core/flags/lb.gif +0 -0
- data/app/assets/images/dm_core/flags/lc.gif +0 -0
- data/app/assets/images/dm_core/flags/li.gif +0 -0
- data/app/assets/images/dm_core/flags/lk.gif +0 -0
- data/app/assets/images/dm_core/flags/lr.gif +0 -0
- data/app/assets/images/dm_core/flags/ls.gif +0 -0
- data/app/assets/images/dm_core/flags/lt.gif +0 -0
- data/app/assets/images/dm_core/flags/lu.gif +0 -0
- data/app/assets/images/dm_core/flags/lv.gif +0 -0
- data/app/assets/images/dm_core/flags/ly.gif +0 -0
- data/app/assets/images/dm_core/flags/ma.gif +0 -0
- data/app/assets/images/dm_core/flags/mc.gif +0 -0
- data/app/assets/images/dm_core/flags/md.gif +0 -0
- data/app/assets/images/dm_core/flags/mg.gif +0 -0
- data/app/assets/images/dm_core/flags/mh.gif +0 -0
- data/app/assets/images/dm_core/flags/mk.gif +0 -0
- data/app/assets/images/dm_core/flags/ml.gif +0 -0
- data/app/assets/images/dm_core/flags/mm.gif +0 -0
- data/app/assets/images/dm_core/flags/mn.gif +0 -0
- data/app/assets/images/dm_core/flags/mo.gif +0 -0
- data/app/assets/images/dm_core/flags/mp.gif +0 -0
- data/app/assets/images/dm_core/flags/mq.gif +0 -0
- data/app/assets/images/dm_core/flags/mr.gif +0 -0
- data/app/assets/images/dm_core/flags/ms.gif +0 -0
- data/app/assets/images/dm_core/flags/mt.gif +0 -0
- data/app/assets/images/dm_core/flags/mu.gif +0 -0
- data/app/assets/images/dm_core/flags/mv.gif +0 -0
- data/app/assets/images/dm_core/flags/mw.gif +0 -0
- data/app/assets/images/dm_core/flags/mx.gif +0 -0
- data/app/assets/images/dm_core/flags/my.gif +0 -0
- data/app/assets/images/dm_core/flags/mz.gif +0 -0
- data/app/assets/images/dm_core/flags/na.gif +0 -0
- data/app/assets/images/dm_core/flags/nc.gif +0 -0
- data/app/assets/images/dm_core/flags/ne.gif +0 -0
- data/app/assets/images/dm_core/flags/nf.gif +0 -0
- data/app/assets/images/dm_core/flags/ng.gif +0 -0
- data/app/assets/images/dm_core/flags/ni.gif +0 -0
- data/app/assets/images/dm_core/flags/nl.gif +0 -0
- data/app/assets/images/dm_core/flags/no.gif +0 -0
- data/app/assets/images/dm_core/flags/np.gif +0 -0
- data/app/assets/images/dm_core/flags/nr.gif +0 -0
- data/app/assets/images/dm_core/flags/nu.gif +0 -0
- data/app/assets/images/dm_core/flags/nz.gif +0 -0
- data/app/assets/images/dm_core/flags/om.gif +0 -0
- data/app/assets/images/dm_core/flags/pa.gif +0 -0
- data/app/assets/images/dm_core/flags/pe.gif +0 -0
- data/app/assets/images/dm_core/flags/pf.gif +0 -0
- data/app/assets/images/dm_core/flags/pg.gif +0 -0
- data/app/assets/images/dm_core/flags/ph.gif +0 -0
- data/app/assets/images/dm_core/flags/pk.gif +0 -0
- data/app/assets/images/dm_core/flags/pl.gif +0 -0
- data/app/assets/images/dm_core/flags/pm.gif +0 -0
- data/app/assets/images/dm_core/flags/pn.gif +0 -0
- data/app/assets/images/dm_core/flags/pr.gif +0 -0
- data/app/assets/images/dm_core/flags/ps.gif +0 -0
- data/app/assets/images/dm_core/flags/pt.gif +0 -0
- data/app/assets/images/dm_core/flags/pw.gif +0 -0
- data/app/assets/images/dm_core/flags/py.gif +0 -0
- data/app/assets/images/dm_core/flags/qa.gif +0 -0
- data/app/assets/images/dm_core/flags/ro.gif +0 -0
- data/app/assets/images/dm_core/flags/ru.gif +0 -0
- data/app/assets/images/dm_core/flags/rw.gif +0 -0
- data/app/assets/images/dm_core/flags/sa.gif +0 -0
- data/app/assets/images/dm_core/flags/sb.gif +0 -0
- data/app/assets/images/dm_core/flags/sc.gif +0 -0
- data/app/assets/images/dm_core/flags/scotland.gif +0 -0
- data/app/assets/images/dm_core/flags/sd.gif +0 -0
- data/app/assets/images/dm_core/flags/se.gif +0 -0
- data/app/assets/images/dm_core/flags/sg.gif +0 -0
- data/app/assets/images/dm_core/flags/sh.gif +0 -0
- data/app/assets/images/dm_core/flags/si.gif +0 -0
- data/app/assets/images/dm_core/flags/sk.gif +0 -0
- data/app/assets/images/dm_core/flags/sl.gif +0 -0
- data/app/assets/images/dm_core/flags/sm.gif +0 -0
- data/app/assets/images/dm_core/flags/sn.gif +0 -0
- data/app/assets/images/dm_core/flags/so.gif +0 -0
- data/app/assets/images/dm_core/flags/sr.gif +0 -0
- data/app/assets/images/dm_core/flags/st.gif +0 -0
- data/app/assets/images/dm_core/flags/sv.gif +0 -0
- data/app/assets/images/dm_core/flags/sy.gif +0 -0
- data/app/assets/images/dm_core/flags/sz.gif +0 -0
- data/app/assets/images/dm_core/flags/tc.gif +0 -0
- data/app/assets/images/dm_core/flags/td.gif +0 -0
- data/app/assets/images/dm_core/flags/tf.gif +0 -0
- data/app/assets/images/dm_core/flags/tg.gif +0 -0
- data/app/assets/images/dm_core/flags/th.gif +0 -0
- data/app/assets/images/dm_core/flags/tj.gif +0 -0
- data/app/assets/images/dm_core/flags/tk.gif +0 -0
- data/app/assets/images/dm_core/flags/tl.gif +0 -0
- data/app/assets/images/dm_core/flags/tm.gif +0 -0
- data/app/assets/images/dm_core/flags/tn.gif +0 -0
- data/app/assets/images/dm_core/flags/to.gif +0 -0
- data/app/assets/images/dm_core/flags/tr.gif +0 -0
- data/app/assets/images/dm_core/flags/tt.gif +0 -0
- data/app/assets/images/dm_core/flags/tv.gif +0 -0
- data/app/assets/images/dm_core/flags/tw.gif +0 -0
- data/app/assets/images/dm_core/flags/tz.gif +0 -0
- data/app/assets/images/dm_core/flags/ua.gif +0 -0
- data/app/assets/images/dm_core/flags/ug.gif +0 -0
- data/app/assets/images/dm_core/flags/um.gif +0 -0
- data/app/assets/images/dm_core/flags/us.gif +0 -0
- data/app/assets/images/dm_core/flags/uy.gif +0 -0
- data/app/assets/images/dm_core/flags/uz.gif +0 -0
- data/app/assets/images/dm_core/flags/va.gif +0 -0
- data/app/assets/images/dm_core/flags/vc.gif +0 -0
- data/app/assets/images/dm_core/flags/ve.gif +0 -0
- data/app/assets/images/dm_core/flags/vg.gif +0 -0
- data/app/assets/images/dm_core/flags/vi.gif +0 -0
- data/app/assets/images/dm_core/flags/vn.gif +0 -0
- data/app/assets/images/dm_core/flags/vu.gif +0 -0
- data/app/assets/images/dm_core/flags/wales.gif +0 -0
- data/app/assets/images/dm_core/flags/wf.gif +0 -0
- data/app/assets/images/dm_core/flags/ws.gif +0 -0
- data/app/assets/images/dm_core/flags/ye.gif +0 -0
- data/app/assets/images/dm_core/flags/yt.gif +0 -0
- data/app/assets/images/dm_core/flags/za.gif +0 -0
- data/app/assets/images/dm_core/flags/zm.gif +0 -0
- data/app/assets/images/dm_core/flags/zw.gif +0 -0
- data/app/assets/images/dm_core/user.gif +0 -0
- data/app/assets/javascripts/dm_core/admin.js +223 -0
- data/app/assets/javascripts/dm_core/admin_extra.js.coffee +118 -0
- data/app/assets/javascripts/dm_core/application.js +14 -0
- data/app/assets/javascripts/dm_core/common_js.js.coffee +61 -0
- data/app/assets/javascripts/dm_core/underscore-1.4.4-min.js +1 -0
- data/app/assets/javascripts/dm_core/underscore-1.4.4.js +1227 -0
- data/app/assets/stylesheets/dm_core/admin.css +250 -0
- data/app/assets/stylesheets/dm_core/application.css +31 -0
- data/app/assets/stylesheets/dm_core/font-awesome.css +1479 -0
- data/app/assets/stylesheets/dm_core/font/FontAwesome.otf +0 -0
- data/app/assets/stylesheets/dm_core/font/fontawesome-webfont.eot +0 -0
- data/app/assets/stylesheets/dm_core/font/fontawesome-webfont.svg +399 -0
- data/app/assets/stylesheets/dm_core/font/fontawesome-webfont.ttf +0 -0
- data/app/assets/stylesheets/dm_core/font/fontawesome-webfont.woff +0 -0
- data/app/controllers/dm_core/admin/accounts_controller.rb +125 -0
- data/app/controllers/dm_core/admin/admin_controller.rb +133 -0
- data/app/controllers/dm_core/admin/comments_controller.rb +70 -0
- data/app/controllers/dm_core/admin/dashboard_controller.rb +38 -0
- data/app/controllers/dm_core/admin/system_controller.rb +44 -0
- data/app/controllers/dm_core/admin/users_controller.rb +106 -0
- data/app/controllers/dm_core/application_controller.rb +253 -0
- data/app/controllers/dm_core/concerns/profile_controller.rb +41 -0
- data/app/controllers/dm_core/profile_controller.rb +8 -0
- data/app/datatables/user_datatable.rb +75 -0
- data/app/helpers/devise_helper.rb +25 -0
- data/app/helpers/dm_core/account_helper.rb +70 -0
- data/app/helpers/dm_core/admin/application_helper.rb +23 -0
- data/app/helpers/dm_core/application_helper.rb +58 -0
- data/app/helpers/dm_core/liquid_helper.rb +79 -0
- data/app/helpers/dm_core/params_helper.rb +19 -0
- data/app/helpers/dm_core/render_helper.rb +104 -0
- data/app/helpers/dm_core/url_helper.rb +189 -0
- data/app/helpers/dm_utilities/currency_helper.rb +24 -0
- data/app/helpers/dm_utilities/date_helper.rb +72 -0
- data/app/inputs/code_editor_input.rb +51 -0
- data/app/inputs/text_full_width_input.rb +9 -0
- data/app/inputs/toggle_checked_input.rb +9 -0
- data/app/inputs/toggle_input.rb +9 -0
- data/app/mailers/dm_core/site_mailer.rb +18 -0
- data/app/models/account.rb +241 -0
- data/app/models/activity.rb +10 -0
- data/app/models/address.rb +24 -0
- data/app/models/category.rb +18 -0
- data/app/models/comment.rb +24 -0
- data/app/models/custom_field.rb +99 -0
- data/app/models/custom_field_def.rb +61 -0
- data/app/models/dm_core/concerns/ability.rb +17 -0
- data/app/models/dm_core/concerns/defines_custom_fields.rb +17 -0
- data/app/models/dm_core/concerns/friendly_id.rb +57 -0
- data/app/models/dm_core/concerns/has_custom_fields.rb +28 -0
- data/app/models/dm_core/concerns/public_private.rb +151 -0
- data/app/models/dm_core/concerns/user.rb +144 -0
- data/app/models/dm_core/concerns/user_profile.rb +113 -0
- data/app/models/dm_core/concerns/user_site_profile.rb +65 -0
- data/app/models/dm_core/country.rb +8 -0
- data/app/models/dm_core/language.rb +59 -0
- data/app/models/dm_core/permitted_params.rb +52 -0
- data/app/models/follow.rb +13 -0
- data/app/models/liquid_validator.rb +26 -0
- data/app/models/payment_history.rb +57 -0
- data/app/models/presence_default_locale_validator.rb +12 -0
- data/app/models/role.rb +12 -0
- data/app/models/system_email.rb +15 -0
- data/app/models/ultracart/notification.rb +107 -0
- data/app/models/ultracart/payment_history.rb +55 -0
- data/app/models/user.rb +22 -0
- data/app/models/user_profile.rb +9 -0
- data/app/models/user_site_profile.rb +11 -0
- data/app/presenters/base_presenter.rb +30 -0
- data/app/presenters/comment_presenter.rb +20 -0
- data/app/presenters/user_presenter.rb +48 -0
- data/app/uploaders/avatar_uploader.rb +75 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +7 -0
- data/app/views/devise/mailer/confirmation_instructions.text.erb +7 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +9 -0
- data/app/views/devise/mailer/reset_password_instructions.text.erb +9 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/mailer/unlock_instructions.text.erb +7 -0
- data/app/views/dm_core/admin/accounts/_settings_menu.html.erb +24 -0
- data/app/views/dm_core/admin/accounts/analytics.html.erb +38 -0
- data/app/views/dm_core/admin/accounts/email.html.erb +26 -0
- data/app/views/dm_core/admin/accounts/general.html.erb +22 -0
- data/app/views/dm_core/admin/accounts/media.html.erb +37 -0
- data/app/views/dm_core/admin/accounts/metadata.html.erb +22 -0
- data/app/views/dm_core/admin/comments/_comment.html.erb +14 -0
- data/app/views/dm_core/admin/comments/_comment_edit_form.html.erb +3 -0
- data/app/views/dm_core/admin/comments/_comment_form.html.erb +15 -0
- data/app/views/dm_core/admin/comments/_comment_list.html.erb +5 -0
- data/app/views/dm_core/admin/comments/_comment_section.html.erb +7 -0
- data/app/views/dm_core/admin/comments/create.js.erb +4 -0
- data/app/views/dm_core/admin/comments/destroy.js.erb +1 -0
- data/app/views/dm_core/admin/comments/edit.js.erb +2 -0
- data/app/views/dm_core/admin/comments/update.js.erb +2 -0
- data/app/views/dm_core/admin/custom_fields/_check_box_collection.html.erb +4 -0
- data/app/views/dm_core/admin/custom_fields/_custom_field_def_fields.html.erb +34 -0
- data/app/views/dm_core/admin/custom_fields/_divider.html.erb +1 -0
- data/app/views/dm_core/admin/custom_fields/_number_field.html.erb +4 -0
- data/app/views/dm_core/admin/custom_fields/_radio_buttons.html.erb +4 -0
- data/app/views/dm_core/admin/custom_fields/_select.html.erb +4 -0
- data/app/views/dm_core/admin/custom_fields/_text_area.html.erb +4 -0
- data/app/views/dm_core/admin/custom_fields/_text_field.html.erb +4 -0
- data/app/views/dm_core/admin/dashboard/_index_sidebar.html.erb +22 -0
- data/app/views/dm_core/admin/dashboard/_widget_recent_new_users.html.erb +23 -0
- data/app/views/dm_core/admin/dashboard/_widget_recent_user_activity.html.erb +21 -0
- data/app/views/dm_core/admin/dashboard/index.html.erb +7 -0
- data/app/views/dm_core/admin/dashboard/update_site_assets.html.erb +5 -0
- data/app/views/dm_core/admin/shared/_header_stats_new_users.html.erb +2 -0
- data/app/views/dm_core/admin/shared/_header_stats_user_activity.html.erb +2 -0
- data/app/views/dm_core/admin/system/show.html.erb +23 -0
- data/app/views/dm_core/admin/users/_form.html.erb +44 -0
- data/app/views/dm_core/admin/users/edit.html.erb +201 -0
- data/app/views/dm_core/admin/users/index.html.erb +30 -0
- data/app/views/dm_core/profile/_profile_sidebar.html.erb +6 -0
- data/app/views/dm_core/profile/account.html.erb +38 -0
- data/app/views/dm_core/profile/details.html.erb +38 -0
- data/app/views/layouts/dm_core/application.html.erb +14 -0
- data/app/views/layouts/dm_core/maintenance.html.erb +31 -0
- data/app/views/layouts/email_templates/default_email_layout.html.erb +289 -0
- data/config/initializers/_dm_core.rb +7 -0
- data/config/initializers/carrierwave.rb +33 -0
- data/config/initializers/devise.rb +252 -0
- data/config/initializers/friendly_id.rb +88 -0
- data/config/initializers/globalize_easy_accessors.rb +67 -0
- data/config/initializers/globalize_papertrail_fix.rb +20 -0
- data/config/initializers/globalize_reflections.rb +22 -0
- data/config/initializers/rolify.rb +8 -0
- data/config/initializers/simple_form.rb +161 -0
- data/config/initializers/simple_form_amsterdam.rb +31 -0
- data/config/initializers/simple_form_bootstrap.rb +87 -0
- data/config/initializers/simple_form_bootstrap3.rb +175 -0
- data/config/initializers/will_paginate.rb +87 -0
- data/config/locales/custom.cs.yml +82 -0
- data/config/locales/custom.de.yml +82 -0
- data/config/locales/custom.en.yml +84 -0
- data/config/locales/custom.fi.yml +84 -0
- data/config/locales/custom.ja.yml +84 -0
- data/config/locales/devise.cs.yml +70 -0
- data/config/locales/devise.de.yml +60 -0
- data/config/locales/devise.en.yml +59 -0
- data/config/locales/devise.fi.yml +57 -0
- data/config/locales/devise.ja.yml +102 -0
- data/config/locales/rails.cs.yml +211 -0
- data/config/locales/rails.de-AT.yml +203 -0
- data/config/locales/rails.de.yml +203 -0
- data/config/locales/rails.en-GB.yml +205 -0
- data/config/locales/rails.en-IN.yml +205 -0
- data/config/locales/rails.en.yml +205 -0
- data/config/locales/rails.fi.yml +199 -0
- data/config/locales/rails.fr-CH.yml +207 -0
- data/config/locales/rails.fr.yml +215 -0
- data/config/locales/rails.ja.yml +197 -0
- data/config/locales/simple_form.cs.yml +26 -0
- data/config/locales/simple_form.de.yml +26 -0
- data/config/locales/simple_form.en.yml +26 -0
- data/config/locales/simple_form.fi.yml +26 -0
- data/config/locales/simple_form.ja.yml +26 -0
- data/config/routes.rb +33 -0
- data/db/globalize_seed_data.sql +76 -0
- data/db/migrate/20121023202117_add_globalize_countries.rb +49 -0
- data/db/migrate/20121028125329_devise_create_users.rb +45 -0
- data/db/migrate/20121028125831_add_user_fields.rb +13 -0
- data/db/migrate/20121028153317_rolify_create_roles.rb +19 -0
- data/db/migrate/20121105205634_add_last_access.rb +9 -0
- data/db/migrate/20121110213512_create_versions.rb +18 -0
- data/db/migrate/20121110213513_add_object_changes_column_to_versions.rb +11 -0
- data/db/migrate/20130206121535_create_dm_core_accounts.rb +12 -0
- data/db/migrate/20130206223323_add_account_to_users.rb +8 -0
- data/db/migrate/20130207170247_create_preferences.rb +12 -0
- data/db/migrate/20130321144726_create_comments.rb +21 -0
- data/db/migrate/20130402203739_add_activity.rb +20 -0
- data/db/migrate/20130415095617_add_type_to_comments.rb +8 -0
- data/db/migrate/20130429191051_add_category.rb +27 -0
- data/db/migrate/20130513112751_create_email_table.rb +25 -0
- data/db/migrate/20130516143539_add_user_profile.rb +45 -0
- data/db/migrate/20130518155712_add_profile_email.rb +13 -0
- data/db/migrate/20130620145610_create_payment_history.rb +36 -0
- data/db/migrate/20130625091108_change_anchor_field.rb +9 -0
- data/db/migrate/20130628112848_create_user_site_profile.rb +26 -0
- data/db/migrate/20130708150236_add_avatar.rb +11 -0
- data/db/migrate/20130914132041_add_notify_to_payment_history.rb +7 -0
- data/db/migrate/20140105133446_acts_as_votable_migration.rb +27 -0
- data/db/migrate/20140107112418_add_user_site_profile_uuid.rb +18 -0
- data/db/migrate/20140129110547_add_invoice_id.rb +6 -0
- data/db/migrate/20140201092656_acts_as_follower_migration.rb +17 -0
- data/db/migrate/20140203131320_rename_invoice_id.rb +11 -0
- data/db/migrate/20140210195143_add_core_addresses.rb +17 -0
- data/db/migrate/20140411190454_papertrail_increase_column.rb +8 -0
- data/db/migrate/20140501160009_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +31 -0
- data/db/migrate/20140501160010_add_missing_unique_indices.acts_as_taggable_on_engine.rb +22 -0
- data/db/migrate/20140501160011_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +15 -0
- data/db/migrate/20140529164730_create_custom_fields.rb +39 -0
- data/db/migrate/20140709145503_add_missing_taggable_index.acts_as_taggable_on_engine.rb +10 -0
- data/db/migrate/20141216094639_add_favored_locale.rb +18 -0
- data/db/migrate/20160128094739_update_papertrail_v4.rb +73 -0
- data/db/migrate/20160630095745_create_delayed_jobs.rb +22 -0
- data/db/migrate/20160821150111_index_foreign_keys_in_core_accounts.rb +5 -0
- data/db/migrate/20160821150113_index_foreign_keys_in_core_addresses.rb +5 -0
- data/db/migrate/20160821150114_index_foreign_keys_in_core_categories.rb +5 -0
- data/db/migrate/20160821150115_index_foreign_keys_in_core_comments.rb +5 -0
- data/db/migrate/20160821150116_index_foreign_keys_in_core_custom_fields.rb +5 -0
- data/db/migrate/20160821150117_index_foreign_keys_in_core_payment_histories.rb +7 -0
- data/db/migrate/20160821150118_index_foreign_keys_in_core_system_email_translations.rb +5 -0
- data/db/migrate/20160821150119_index_foreign_keys_in_core_system_emails.rb +6 -0
- data/db/migrate/20160821150128_index_foreign_keys_in_preferences.rb +5 -0
- data/db/migrate/20160821150129_index_foreign_keys_in_roles.rb +5 -0
- data/db/migrate/20160821150130_index_foreign_keys_in_taggings.rb +5 -0
- data/db/migrate/20160821150131_index_foreign_keys_in_user_profiles.rb +7 -0
- data/db/migrate/20160821150132_index_foreign_keys_in_user_site_profiles.rb +6 -0
- data/db/migrate/20160821150133_index_foreign_keys_in_users_roles.rb +5 -0
- data/db/migrate/20160821150134_index_foreign_keys_in_version_associations.rb +5 -0
- data/db/migrate/20160821150135_index_foreign_keys_in_versions.rb +5 -0
- data/db/seeds.rb +433 -0
- data/db/seeds/globalize_countries.rb +239 -0
- data/db/seeds/globalize_languages.rb +186 -0
- data/lib/dm_core.rb +38 -0
- data/lib/dm_core/csv_exporter.rb +210 -0
- data/lib/dm_core/csv_importer.rb +16 -0
- data/lib/dm_core/engine.rb +51 -0
- data/lib/dm_core/liquid_extensions.rb +125 -0
- data/lib/dm_core/nls.rb +31 -0
- data/lib/dm_core/scio_excel.rb +501 -0
- data/lib/dm_core/state_select.rb +135 -0
- data/lib/dm_core/version.rb +3 -0
- data/lib/tasks/dm_core_tasks.rake +60 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/ability.rb +10 -0
- data/spec/dummy/app/models/user.rb +6 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +27 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +82 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +11 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +399 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +374 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/factories/accounts.rb +9 -0
- data/spec/factories/user_profiles.rb +10 -0
- data/spec/factories/users.rb +19 -0
- data/spec/helpers/account_helper_spec.rb +50 -0
- data/spec/models/account_spec.rb +20 -0
- data/spec/models/user_spec.rb +99 -0
- data/spec/rails_helper.rb +70 -0
- data/spec/spec_helper.rb +85 -0
- data/spec/support/accounts.rb +19 -0
- data/spec/support/devise.rb +44 -0
- data/spec/support/fix_locale.rb +57 -0
- metadata +1124 -0
@@ -0,0 +1,49 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
#------------------------------------------------------------------------------
|
3
|
+
class AddGlobalizeCountries < ActiveRecord::Migration
|
4
|
+
def up
|
5
|
+
create_table "globalize_countries", :force => true do |t|
|
6
|
+
t.string "code", :limit => 2
|
7
|
+
t.string "english_name"
|
8
|
+
t.string "date_format"
|
9
|
+
t.string "currency_format"
|
10
|
+
t.string "currency_code", :limit => 3
|
11
|
+
t.string "thousands_sep", :limit => 2
|
12
|
+
t.string "decimal_sep", :limit => 2
|
13
|
+
t.string "currency_decimal_sep", :limit => 2
|
14
|
+
t.string "number_grouping_scheme"
|
15
|
+
t.string "continent"
|
16
|
+
t.string "locale"
|
17
|
+
end
|
18
|
+
|
19
|
+
add_index "globalize_countries", ["code"], :name => "index_globalize_countries_on_code"
|
20
|
+
add_index "globalize_countries", ["locale"], :name => "index_globalize_countries_on_locale"
|
21
|
+
|
22
|
+
create_table "globalize_languages", :force => true do |t|
|
23
|
+
t.string "iso_639_1", :limit => 2
|
24
|
+
t.string "iso_639_2", :limit => 3
|
25
|
+
t.string "iso_639_3", :limit => 3
|
26
|
+
t.string "rfc_3066"
|
27
|
+
t.string "english_name"
|
28
|
+
t.string "english_name_locale"
|
29
|
+
t.string "english_name_modifier"
|
30
|
+
t.string "native_name"
|
31
|
+
t.string "native_name_locale"
|
32
|
+
t.string "native_name_modifier"
|
33
|
+
t.boolean "macro_language"
|
34
|
+
t.string "direction"
|
35
|
+
t.string "pluralization"
|
36
|
+
t.string "scope", :limit => 1
|
37
|
+
end
|
38
|
+
|
39
|
+
add_index "globalize_languages", ["iso_639_1"], :name => "index_globalize_languages_on_iso_639_1"
|
40
|
+
add_index "globalize_languages", ["iso_639_2"], :name => "index_globalize_languages_on_iso_639_2"
|
41
|
+
add_index "globalize_languages", ["iso_639_3"], :name => "index_globalize_languages_on_iso_639_3"
|
42
|
+
add_index "globalize_languages", ["rfc_3066"], :name => "index_globalize_languages_on_rfc_3066"
|
43
|
+
end
|
44
|
+
|
45
|
+
def down
|
46
|
+
drop_table :globalize_countries
|
47
|
+
drop_table :globalize_languages
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
class DeviseCreateUsers < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table(:users) do |t|
|
4
|
+
## Database authenticatable
|
5
|
+
t.string :email, :null => false, :default => ""
|
6
|
+
t.string :encrypted_password, :null => false, :default => ""
|
7
|
+
|
8
|
+
## Recoverable
|
9
|
+
t.string :reset_password_token
|
10
|
+
t.datetime :reset_password_sent_at
|
11
|
+
|
12
|
+
## Rememberable
|
13
|
+
t.datetime :remember_created_at
|
14
|
+
|
15
|
+
## Trackable
|
16
|
+
t.integer :sign_in_count, :default => 0
|
17
|
+
t.datetime :current_sign_in_at
|
18
|
+
t.datetime :last_sign_in_at
|
19
|
+
t.string :current_sign_in_ip
|
20
|
+
t.string :last_sign_in_ip
|
21
|
+
|
22
|
+
## Confirmable
|
23
|
+
t.string :confirmation_token
|
24
|
+
t.datetime :confirmed_at
|
25
|
+
t.datetime :confirmation_sent_at
|
26
|
+
t.string :unconfirmed_email # Only if using reconfirmable
|
27
|
+
|
28
|
+
## Lockable
|
29
|
+
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
|
30
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
31
|
+
# t.datetime :locked_at
|
32
|
+
|
33
|
+
## Token authenticatable
|
34
|
+
# t.string :authentication_token
|
35
|
+
|
36
|
+
t.timestamps null: true
|
37
|
+
end
|
38
|
+
|
39
|
+
add_index :users, :email, :unique => true
|
40
|
+
add_index :users, :reset_password_token, :unique => true
|
41
|
+
add_index :users, :confirmation_token, :unique => true
|
42
|
+
# add_index :users, :unlock_token, :unique => true
|
43
|
+
# add_index :users, :authentication_token, :unique => true
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddUserFields < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
add_column :users, :first_name, :string
|
4
|
+
add_column :users, :last_name, :string
|
5
|
+
add_column :users, :country_id, :integer
|
6
|
+
end
|
7
|
+
|
8
|
+
def down
|
9
|
+
remove_column :users, :first_name
|
10
|
+
remove_column :users, :last_name
|
11
|
+
remove_column :users, :country_id
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class RolifyCreateRoles < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table(:roles) do |t|
|
4
|
+
t.string :name
|
5
|
+
t.references :resource, :polymorphic => true
|
6
|
+
|
7
|
+
t.timestamps null: true
|
8
|
+
end
|
9
|
+
|
10
|
+
create_table(:users_roles, :id => false) do |t|
|
11
|
+
t.references :user
|
12
|
+
t.references :role
|
13
|
+
end
|
14
|
+
|
15
|
+
add_index(:roles, :name)
|
16
|
+
add_index(:roles, [ :name, :resource_type, :resource_id ])
|
17
|
+
add_index(:users_roles, [ :user_id, :role_id ])
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateVersions < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :versions do |t|
|
4
|
+
t.string :item_type, :null => false
|
5
|
+
t.integer :item_id, :null => false
|
6
|
+
t.string :event, :null => false
|
7
|
+
t.string :whodunnit
|
8
|
+
t.text :object
|
9
|
+
t.datetime :created_at
|
10
|
+
end
|
11
|
+
add_index :versions, [:item_type, :item_id]
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
remove_index :versions, [:item_type, :item_id]
|
16
|
+
drop_table :versions
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class AddObjectChangesColumnToVersions < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :versions, :object_changes, :text
|
4
|
+
add_column :versions, :locale, :string
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_column :versions, :object_changes
|
9
|
+
remove_column :versions, :locale
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateDmCoreAccounts < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :core_accounts do |t|
|
4
|
+
t.string :company_name
|
5
|
+
t.string :contact_email
|
6
|
+
t.string :domain
|
7
|
+
t.string :account_prefix
|
8
|
+
t.integer :default_site_id
|
9
|
+
t.timestamps null: true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreatePreferences < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :preferences do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.references :owner, :polymorphic => true, :null => false
|
6
|
+
t.references :group, :polymorphic => true
|
7
|
+
t.string :value
|
8
|
+
t.timestamps null: true
|
9
|
+
end
|
10
|
+
add_index :preferences, [:owner_id, :owner_type, :name, :group_id, :group_type], :unique => true, :name => 'index_preferences_on_owner_and_name_and_preference'
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateComments < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :core_comments do |t|
|
4
|
+
t.string :title, :limit => 50, :default => ""
|
5
|
+
t.text :comment
|
6
|
+
t.references :commentable, :polymorphic => true
|
7
|
+
t.references :user
|
8
|
+
t.string :role, :default => "comments"
|
9
|
+
t.integer :account_id
|
10
|
+
t.timestamps null: true
|
11
|
+
end
|
12
|
+
|
13
|
+
add_index :core_comments, :commentable_type
|
14
|
+
add_index :core_comments, :commentable_id
|
15
|
+
add_index :core_comments, :user_id
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.down
|
19
|
+
drop_table :core_comments
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class AddActivity < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :core_activities do |t|
|
4
|
+
t.integer :account_id
|
5
|
+
t.references :user
|
6
|
+
t.string :browser
|
7
|
+
t.string :session_id
|
8
|
+
t.string :ip_address
|
9
|
+
t.string :controller
|
10
|
+
t.string :action
|
11
|
+
t.string :params
|
12
|
+
t.string :slug
|
13
|
+
t.string :lesson
|
14
|
+
t.datetime :created_at
|
15
|
+
end
|
16
|
+
|
17
|
+
add_index :core_activities, :account_id
|
18
|
+
add_index :core_activities, :user_id
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
class AddTypeToComments < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
add_column :core_comments, :type, :string
|
4
|
+
add_column :core_comments, :ancestry, :string
|
5
|
+
add_column :core_comments, :ancestry_depth, :integer, :default => 0
|
6
|
+
rename_column :core_comments, :comment, :body
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class AddCategory < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table "core_category_translations", :force => true do |t|
|
4
|
+
t.integer :core_category_id
|
5
|
+
t.string :locale
|
6
|
+
t.string :name
|
7
|
+
t.string :description
|
8
|
+
t.datetime :created_at
|
9
|
+
t.datetime :updated_at
|
10
|
+
end
|
11
|
+
|
12
|
+
add_index "core_category_translations", ["core_category_id"], :name => "index_category_translation"
|
13
|
+
|
14
|
+
create_table "core_categories", :force => true do |t|
|
15
|
+
t.string :type
|
16
|
+
t.integer :row_order
|
17
|
+
t.integer :account_id
|
18
|
+
t.datetime :created_on
|
19
|
+
t.datetime :updated_on
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def down
|
24
|
+
drop_table :core_categories
|
25
|
+
drop_table :core_category_translations
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class CreateEmailTable < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :core_system_email_translations, :force => true do |t|
|
4
|
+
t.integer :core_system_email_id
|
5
|
+
t.string :locale
|
6
|
+
t.string :subject
|
7
|
+
t.text :body
|
8
|
+
t.datetime :created_at
|
9
|
+
t.datetime :updated_at
|
10
|
+
end
|
11
|
+
|
12
|
+
create_table :core_system_emails, :force => true do |t|
|
13
|
+
t.string :email_type
|
14
|
+
t.references :emailable, :polymorphic => true
|
15
|
+
t.datetime :created_at
|
16
|
+
t.datetime :updated_at
|
17
|
+
t.integer :account_id
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def down
|
22
|
+
drop_table :core_system_emails
|
23
|
+
drop_table :core_system_email_translations
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
class AddUserProfile < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :user_profiles, :force => true do |t|
|
4
|
+
t.integer :user_id
|
5
|
+
t.string :public_name, :limit => 50, :default => ""
|
6
|
+
t.string :first_name, :limit => 50, :default => ""
|
7
|
+
t.string :last_name, :limit => 50, :default => ""
|
8
|
+
t.string :address, :limit => 70, :default => ""
|
9
|
+
t.string :address2, :limit => 70, :default => ""
|
10
|
+
t.string :city, :limit => 30, :default => ""
|
11
|
+
t.string :state, :limit => 30, :default => ""
|
12
|
+
t.string :zipcode, :limit => 10, :default => ""
|
13
|
+
t.integer :country_id, :default => 0
|
14
|
+
t.string :phone, :limit => 20, :default => ""
|
15
|
+
t.string :cell, :limit => 20, :default => ""
|
16
|
+
t.string :fax, :limit => 20, :default => ""
|
17
|
+
t.string :workphone, :limit => 20, :default => ""
|
18
|
+
t.string :website, :limit => 50, :default => ""
|
19
|
+
t.string :gender, :limit => 1, :default => ""
|
20
|
+
t.integer :status, :default => 0
|
21
|
+
t.integer :lock_version, :default => 0
|
22
|
+
t.datetime :last_access_at
|
23
|
+
t.datetime :created_at
|
24
|
+
t.datetime :updated_at
|
25
|
+
t.integer :account_id
|
26
|
+
end
|
27
|
+
|
28
|
+
User.all.find_each do |user|
|
29
|
+
Account.current = Account.find(user.account_id)
|
30
|
+
p = user.create_user_profile
|
31
|
+
p.update_attributes(first_name: user.attributes['first_name'], last_name: user.attributes['last_name'],
|
32
|
+
country_id: user.attributes['country_id'],
|
33
|
+
public_name: "#{user.attributes['first_name']}")
|
34
|
+
p.update_attribute(:last_access_at, user.attributes['last_access_at'])
|
35
|
+
end
|
36
|
+
remove_column :users, :first_name
|
37
|
+
remove_column :users, :last_name
|
38
|
+
remove_column :users, :country_id
|
39
|
+
remove_column :users, :last_access_at
|
40
|
+
end
|
41
|
+
|
42
|
+
def down
|
43
|
+
drop_table :user_profiles
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddProfileEmail < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
add_column :user_profiles, :email, :string
|
4
|
+
User.all.find_each do |user|
|
5
|
+
Account.current = Account.find(user.account_id)
|
6
|
+
user.user_profile.update_attribute(:email, user.attributes['email'])
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def down
|
11
|
+
remove_column :user_profiles, :email
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
class CreatePaymentHistory < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :core_payment_histories, :force => true do |t|
|
4
|
+
t.integer :owner_id
|
5
|
+
t.string :owner_type, :limit => 30
|
6
|
+
t.integer :anchor_id # unique number tying paid item to our item
|
7
|
+
t.string :order_ref # order number
|
8
|
+
t.string :item_ref # specfic item number
|
9
|
+
t.string :item_name # item's name
|
10
|
+
t.integer :quantity # number of items
|
11
|
+
t.string :cost # cost of item, as a string
|
12
|
+
t.string :discount # any coupon/dicsount
|
13
|
+
t.integer :total_cents # total amount in cents
|
14
|
+
t.string :total_currency, :limit => 3 # currency 3 char code
|
15
|
+
t.string :payment_method # how payment was made: cash, credit card, etc
|
16
|
+
t.datetime :payment_date # date of payment
|
17
|
+
t.string :bill_to_name # who actually paid / was billed to
|
18
|
+
t.text :item_details # any specific item details sent by payment processor
|
19
|
+
t.text :order_details # any specific order details sent by payment processor
|
20
|
+
t.string :current_stage # current stage of payment
|
21
|
+
t.integer :user_profile_id # user_profile if payment was enetered manually
|
22
|
+
t.datetime :created_on
|
23
|
+
t.integer :account_id
|
24
|
+
end
|
25
|
+
|
26
|
+
add_index "core_payment_histories", ["anchor_id"], :name => "index_payment_histories_on_anchor_id"
|
27
|
+
add_index "core_payment_histories", ["item_ref"], :name => "index_payment_histories_on_item_ref"
|
28
|
+
add_index "core_payment_histories", ["order_ref"], :name => "index_payment_histories_on_order_ref"
|
29
|
+
add_index "core_payment_histories", ["owner_id"], :name => "index_payment_histories_on_owner_id"
|
30
|
+
add_index "core_payment_histories", ["owner_type"], :name => "index_payment_histories_on_owner_type"
|
31
|
+
end
|
32
|
+
|
33
|
+
def down
|
34
|
+
drop_table :core_payment_histories
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class CreateUserSiteProfile < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :user_site_profiles, :force => true do |t|
|
4
|
+
t.integer :user_id
|
5
|
+
t.datetime :last_access_at
|
6
|
+
t.datetime :created_at
|
7
|
+
t.datetime :updated_at
|
8
|
+
t.integer :account_id
|
9
|
+
end
|
10
|
+
|
11
|
+
User.all.find_each do |user|
|
12
|
+
Account.current = Account.find(user.account_id)
|
13
|
+
p = user.user_site_profiles.create
|
14
|
+
p.update_attribute(:account_id, user.attributes['account_id'])
|
15
|
+
p.update_attribute(:last_access_at, user.user_profile.attributes['last_access_at'])
|
16
|
+
p.update_attribute(:created_at, user.attributes['created_at'])
|
17
|
+
p.update_attribute(:updated_at, user.attributes['updated_at'])
|
18
|
+
end
|
19
|
+
remove_column :user_profiles, :last_access_at
|
20
|
+
end
|
21
|
+
|
22
|
+
def down
|
23
|
+
drop_table :user_site_profiles
|
24
|
+
add_column :user_profiles, :last_access_at, :datetime
|
25
|
+
end
|
26
|
+
end
|