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
RSpec.describe "Account", :type => :system do | |
it "creates an account" do | |
name = Faker::Name.name | |
email = Faker::Internet.email | |
password = Faker::Alphanumeric.alphanumeric(number: 10) | |
visit sign_up_path | |
within("#new_account") do |
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 ActiveStorage::BaseController < ApplicationController | |
include ActiveStorage::SetCurrent | |
before_action :authenticate_user! | |
protect_from_forgery with: :exception | |
def authenticate_user! | |
if current_user | |
else |
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
= form_tag "/admin/users/#{:id}/edit", method: :get do | |
.row | |
.col-sm-12.col-md-9 | |
= select_tag :id, options_from_collection_for_select(User.all, 'id', 'name',{ prompt: 'Find User' }), class: 'form-control select2' |
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
SELECT id FROM `caffeine_product_options`WHERE `product_option_title` = "we start with 5"; | |
UPDATE caffeine_product_options SET option_qty = option_qty - '$quantity' WHERE id= is_set_from_select |
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
ActionView::Template::Error (undefined method `to_datetime' for 0:Fixnum): | |
208: <div class="col-sm-4 col-xs-7"> | |
209: <%= f.select :dob_month, ['01', '02', '03','04', '05', '06','07', '08', '09','10', '11', '12'], :class => "float-right number", :prompt => "Month" %> | |
210: <%= f.select :dob_day, ['01', '02', '03','04', '05', '06','07', '08', '09','10', '11', '12','13', '14', '15','16', '17', '18','19', '20', '21','22','23', '24', '25','26', '27', '28','29', '30','31'], :class => "form-control margin-ten no-letter number", :prompt => "Day" %> | |
211: <%= f.date_select :dob_year, {:order => [:year], :start_year => 1920, :end_year => Time.now.year, :prompt => "Year" }, {:class => "texter"} %> | |
212: </div> | |
213: </div> | |
214: </div> | |
app/views/devise/registrations/_registrations.html.erb:211:in `block in _app_views_devise_registrations__registrations_html_erb__4136954747110916622_70221770454860' | |
app/views/devise/registrations/_registrations.html.erb: |
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
<%= f.date_select :dob_year, :start_year => 1995, :use_month_numbers => true %> | |
ActionView::Template::Error (undefined method `to_datetime' for 0:Fixnum): | |
208: <div class="col-sm-4 col-xs-7"> | |
1'], :class => "form-control margin-ten no-letter number", :prompt => "Day" %> | |
211: <%= f.date_select :dob_year, {:order => [:year], :start_year => 1920, :end_year => Date.today.year, :prompt => "Year" }, {:class => "texter"} %> | |
213: </div> | |
214: </div> | |
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 NotificationsMailer < ApplicationMailer | |
def notify(params) | |
@subject = params[:notification][:subject] | |
@message = params[:notification][:message] | |
users = params[:notification][:user_ids].reject(&:blank?) | |
additional_emails = params[:notification][:emails] | |
marketers = params[:notification][:marketer_ids].reject(&:blank?) | |
documents = params[:notification][:document_ids].reject(&:blank?) | |
state = params[:notification][:state] |
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
def find_emails_from_extra(search_term, name ) | |
emails = [] | |
emails << User.where(search_term: name).pluck(:email) | |
emails | |
end | |
how can I change the search_term: into whatever the attribute is? | |
so if I do | |
find_email_from_extra(employer_state, "FL") |
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
[ | |
['Alabama', 'AL'], | |
['Alaska', 'AK'], | |
['Arizona', 'AZ'], | |
['Arkansas', 'AR'], | |
['California', 'CA'], | |
['Colorado', 'CO'], | |
['Connecticut', 'CT'], | |
['Delaware', 'DE'], | |
['District Of Columbia', 'DC'], |
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
Document(#70259050585960) expected, got "" which is an instance of String(#70259013172680) | |
class Notification < ApplicationRecord | |
has_and_belongs_to_many :documents | |
has_many :users | |
has_many :marketers | |
end |
NewerOlder