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
Spree::User.class_eval do | |
has_one :profile, dependent: :destroy, autosave: true | |
before_create :build_profile | |
def build_profile | |
if self.has_spree_role?("creative") | |
self.build_profile | |
end | |
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
<!-- insert_top "[data-hook='signup_inside_form']" --> | |
<p> | |
<%= f.label :first_name, Spree.t(:first_name) %> <br/> | |
<%= f.text_field :first_name, class: 'title' %> | |
</p> |
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
module Spree | |
class Cause | |
has_many :products | |
def cumulative_impact | |
Spree::LineItem.select("sum((spree_line_items.price * spree_line_items.quantity * (1/spree_line_items.charity_percent::float)))").joins({variant: {product: :cause}}).where(causes: {id: self.id}) | |
end | |
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
Started GET "/" for 127.0.0.1 at 2013-12-10 21:59:57 -0600 | |
Processing by Spree::HomeController#index as HTML | |
[1m[35mSpree::Preference Load (0.5ms)[0m SELECT "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."key" = 'spree/frontend_configuration/locale' LIMIT 1 | |
Completed 500 Internal Server Error in 59ms | |
ActionView::MissingTemplate (Missing template I"$spree/layouts/spree_application:EF with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :rabl], :versions=>[:v1]}. Searched in: | |
* "/home/david/source/art_to_aid/beta/app/views" | |
* "/home/david/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/spree_auth_devise-9417dd85f99e/app/views" | |
* "/home/david/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/devise-3.0.4/app/views" | |
* "/home/david/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/spree-e9ff8b4fab61/frontend/app/views" |
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
Template is missing | |
Missing template I"$spree/layouts/spree_application:EF with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :rabl], :versions=>[:v1]}. Searched in: * "/home/david/source/art_to_aid/beta/app/views" * "/home/david/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/spree_auth_devise-9417dd85f99e/app/views" * "/home/david/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/devise-3.0.4/app/views" * "/home/david/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/spree-e9ff8b4fab61/frontend/app/views" * "/home/david/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/spree-e9ff8b4fab61/backend/app/views" * "/home/david/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/spree-e9ff8b4fab61/api/app/views" * "/home/david/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/spree-e9ff8b4fab61/core/app/views" * "/home/david/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/kaminari-0.15.0/app/views" |
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
module Spree | |
class CausesController < Spree::StoreController | |
def index | |
@causes = Cause.all | |
super | |
end | |
end | |
end | |
Produces: |
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
Spree::ProductsController.class_eval do | |
def index | |
if params[:search] | |
[:ascend_by_master_price].each do |field| | |
if params[:search][field] && params[:search][field] == '' | |
params[:search][field] = nil | |
end | |
end | |
end | |
@searcher = build_searcher(params) |
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
open_study = Study.where(status: "Open to Accrual").first | |
fields = [self.status, self.date, open_study, open_study.date] | |
if((self.status != "Open to Accrual") && (fields.all?(&:present?)) && (self.date < open_study.date)) | |
errors.add(:date, :greater_than_open_date) | |
end | |
#VS | |
open_study = Study.where(status: "Open to Accrual").first | |
unless self.status == "Open to Accrual" |
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
NoMethodError in Spree/admin/stock_locations#new | |
Showing /home/david/.rvm/gems/ruby-1.9.3-p392/bundler/gems/spree-bb4dbf49e443/backend/app/views/spree/admin/stock_locations/_form.html.erb where line #10 raised: | |
undefined method `admin_name' for #<Spree::StockLocation:0x000000064901a0> | |
Extracted source (around line #10): | |
7: <% end %><br> | |
8: <%= f.field_container :admin_name do %> | |
9: <%= f.label :admin_name, Spree.t(:internal_name) %> |
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
GIT | |
remote: git://github.com/spree/spree.git | |
revision: fea90fb7fb24ad0a9265d45d75d2460806ca310c | |
branch: 2-0-stable | |
specs: | |
spree (2.0.5.beta) | |
spree_api (= 2.0.5.beta) | |
spree_backend (= 2.0.5.beta) | |
spree_cmd (= 2.0.5.beta) | |
spree_core (= 2.0.5.beta) |