This file contains 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
@e = Item.find(50).pictures.first.image.split(",") | |
@e.each do f | |
@g = Picture.new(:image => f, :title => 'multiple file upload test', :user_id => 5, :item_id => 50, :description => "multi upload desc") | |
@g.save | |
end | |
# @e.destroy // eliminate orig image with multiple files in it??? |
This file contains 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
@items += Item.where( "lower(title) ~* ?", "#{params[:s].downcase}".split(/,\s*/).map(&:strip).reject(&:empty?).first) | |
@items += Item.where( "lower(title) ~* ?", "#{params[:s].downcase}".split(/,\s*/).map(&:strip).reject(&:empty?).second) | |
@items += Item.where( "lower(title) ~* ?", "#{params[:s].downcase}".split(/,\s*/).map(&:strip).reject(&:empty?).third) | |
@items += Item.where( "lower(title) ~* ?", "#{params[:s].downcase}".split(/,\s*/).map(&:strip).reject(&:empty?).fourth) |
This file contains 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 EmployeeDemographic < ActiveRecord::Base | |
#Start Activity Tracking | |
include PublicActivity::Model | |
include ::ActivityMethods | |
tracked except: :update, owner: -> (controller, model) { controller && controller.current_user } | |
tracked except: :update, account_id: -> (controller, model) { controller && controller.current_user.account_id } | |
tracked except: :update, user_id: -> (controller, model) { controller && model.user_id } | |
tracked except: :update, activity_type: -> (controller, model) { controller && "private" } | |
monitor_attr_changed :eeo_job_category, :employee_number, :ethnicity, :flsa_code, :hire_date, :performance_review_due, :termination_date, :veteran_status, :ssn | |
#End Activity Tracking |
This file contains 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 Subscription < ActiveRecord::Base | |
belongs_to :deal | |
belongs_to :organization | |
validates_presence_of :email | |
attr_accessor :stripe_card_token, :email, :card_number, :card_code, :card_month, :card_year , :card | |
attr_accessible :organization_id, :deal_id, :stripe_card_token, :email, :name, :description, :card | |
This file contains 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
- @email.deals.each_with_index do |deal, i| | |
- if i%6 == 0 | |
%tr | |
= render :partial => 'admin/emails/gifts', :locals => {:deal => deal, :i => i} |
This file contains 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
- orgs = Organization.all.select{|o| o.deals.count > 0 } | |
- orgs.each do |org| | |
- @d = org.deals.where(:organization_id => org.id, :active => true) | |
- @c = @d.map(&:what) | |
.grid_2.alpha.omega | |
%h3< | |
= select_tag 'email_organization_ids[]', options_from_collection_for_select(@d, :id, :what), :prompt => org.name, :class => 'load-ad', :style => 'width: 90%;' | |
.ad |
This file contains 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
- @email.organizations.each_with_index do |organization, i| | |
- if i%5+1 == col | |
%tr | |
= render :partial => 'admin/emails/banner', :locals => {:organization => organization, :i => i%5+1} |
This file contains 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 AddOrgIDtoPlans2 < ActiveRecord::Migration | |
def change | |
add_column :plans, :organization_id, :integer | |
end | |
end |
This file contains 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 ReferredEmail < Struct.new(:orig_email) | |
def perform | |
# Send to All Card Referrals except for Signups | |
@deals_count = Deal.all.select{|a|a.vote_score > -3 && a.organization.searchable == true}.count | |
referrals = (CardReferral.all.map(&:email).map(&:downcase) - CardSignup.all.map(&:email).map(&:downcase)).uniq | |
email_referrals = orig_email.card_referrals.map(&:email) | |
referrals = referrals - email_referrals |
This file contains 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
[5] pry(#<CardSignupsController>)> request | |
=> #<ActionDispatch::Request:0x007fd4f121a250 | |
@env= | |
{"GATEWAY_INTERFACE"=>"CGI/1.1", | |
"PATH_INFO"=>"/card_signups/go_to_disclaimer", | |
"QUERY_STRING"=>"", | |
"REMOTE_ADDR"=>"127.0.0.1", | |
"REMOTE_HOST"=>"localhost", | |
"REQUEST_METHOD"=>"GET", | |
"REQUEST_URI"=>"http://localhost:3000/card_signups/go_to_disclaimer", |
NewerOlder