bisscomm / refinerycms-products

Products extension for Refinery CMS
MIT License
9 stars 11 forks source link

ActiveRecord::StatementInvalid in Refinery::Products::Admin::Products#index #12

Closed gen1321 closed 9 years ago

gen1321 commented 9 years ago

i got this error affter making 1st product. SQLite3::SQLException: ambiguous column name: updated_at: SELECT DISTINCT "refinery_products"."id" FROM "refinery_products" LEFT OUTER JOIN "refinery_product_translations" ON "refinery_product_translations"."refinery_product_id" = "refinery_products"."id" ORDER BY refinery_product_translations.title, updated_at DESC LIMIT 10 OFFSET 0

#

def prepare sql
  stmt = SQLite3::Statement.new( self, sql )
  return stmt unless block_given?

  begin

my gem file

source 'https://rubygems.org'

gem 'rails', '4.2.1'

group :production, :staging do gem "pg" gem "mysql"

end

gem 'rails_12factor', group: :production

group :development, :test do gem "sqlite3-ruby", "~> 1.3.0", :require => "sqlite3"

end

gem 'sass-rails', '~> 5.0'

gem 'uglifier', '>= 1.3.0'

gem 'coffee-rails', '~> 4.1.0'

gem 'htmlbeautifier'

gem 'jquery-rails' https://github.com/rails/turbolinks gem 'turbolinks'

gem 'jbuilder', '~> 2.0'

gem 'sdoc', '~> 0.4.0', group: :doc

group :development, :test do

gem 'byebug'

gem 'web-console', '~> 2.0'

https://github.com/rails/spring gem 'spring' end

gem 'refinerycms', git: 'https://github.com/refinery/refinerycms', branch: 'master'

gem 'quiet_assets', :group => :development

gem 'refinerycms-acts-as-indexed', ['~> 2.0', '>= 2.0.0']

gem 'refinerycms-wymeditor', ['~> 1.0', '>= 1.0.6']

gem 'refinerycms-blog', git: 'https://github.com/refinery/refinerycms-blog', branch: 'master' gem 'refinerycms-products', github: 'bisscomm/refinerycms-products', branch: '3-0-stable' gem 'refinerycms-page-images', '~> 3.0.0' ,github: 'refinery/refinerycms-page-images', branch: 'master'

gem 'devise', '~> 3.5.1' gem 'fog'

gem 'omniauth' gem 'omniauth-twitter' gem 'omniauth-facebook' gem 'omniauth-linkedin' gem 'omniauth-vkontakte'

gem 'refinerycms-events', path: 'vendor/extensions'

bricesanchez commented 9 years ago

Helllo,

Could you paste your Gemfile.lock ?

zmdroid commented 9 years ago

Hi, I met the same problem.

my Gemfile: source 'https://ruby.taobao.org' gem 'rails', '4.2.4' group :development, :test do gem 'sqlite3' end gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.1.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 2.0' gem 'sdoc', '~> 0.4.0', group: :doc group :development, :test do gem 'byebug' end

group :development do gem 'web-console', '~> 2.0' more: https://github.com/rails/spring gem 'spring' end gem 'refinerycms', git: 'https://github.com/refinery/refinerycms', branch: 'master' gem 'quiet_assets', group: :development gem 'refinerycms-acts-as-indexed', ['~> 2.0', '>= 2.0.0'] gem 'refinerycms-wymeditor', ['~> 1.0', '>= 1.0.6'] gem 'refinerycms-authentication-devise', '~> 1.0' gem 'refinerycms-page-images', git: 'https://github.com/refinery/refinerycms-page-images', branch: 'master' gem "refinerycms-news", git: 'https://github.com/refinery/refinerycms-news', branch: 'master' gem "refinerycms-products", git: 'https://github.com/bisscomm/refinerycms-products', branch: 'master'

this my Gemfile.lock GIT remote: https://github.com/bisscomm/refinerycms-products revision: 843f3efbae1029a402d8c067ad88af78bb5cc52b branch: master specs: refinerycms-products (3.0.0) awesome_nested_set (~> 3.0.0) friendly_id (~> 5.1.0) globalize (>= 4.0.0, < 5.2) refinerycms-acts-as-indexed (~> 2.0.0) refinerycms-core (~> 3.0.0) refinerycms-page-images (~> 3.0.0)

GIT remote: https://github.com/refinery/refinerycms revision: f9c15e8a4478b73a4115095cec545912ad6dd8f6 branch: master specs: refinerycms (3.0.0) refinerycms-core (= 3.0.0) refinerycms-images (= 3.0.0) refinerycms-pages (= 3.0.0) refinerycms-resources (= 3.0.0) refinerycms-core (3.0.0) actionpack (>= 4.2.3, < 5.0) activerecord (>= 4.2.3, < 5.0) awesome_nested_set (~> 3.0.0) coffee-rails (~> 4.0, >= 4.0.0) decorators (~> 2.0.0) jquery-rails (>= 2.3.0) jquery-ui-rails (~> 5.0.0) railties (>= 4.2.3, < 5.0) refinerycms-i18n (~> 3.0.0) sass-rails (>= 4.0, < 5.1) truncate_html (~> 0.9) will_paginate (~> 3.0.2) zilch-authorisation refinerycms-images (3.0.0) dragonfly (~> 1.0.0) globalize (>= 4.0.0, < 5.2) refinerycms-core (= 3.0.0) refinerycms-pages (3.0.0) awesome_nested_set (~> 3.0.0) babosa (!= 0.3.6) friendly_id (~> 5.1.0) globalize (>= 4.0.0, < 5.2) refinerycms-core (= 3.0.0) seo_meta (~> 2.0.0.rc.1) speakingurl-rails (~> 1.1.2) refinerycms-resources (3.0.0) acts_as_indexed (~> 0.8.0) dragonfly (~> 1.0.0) globalize (>= 4.0.0, < 5.2) refinerycms-core (= 3.0.0)

GIT remote: https://github.com/refinery/refinerycms-news revision: 1a72148610487e25c74be05a6e73264c920ac96b branch: master specs: refinerycms-news (3.0.0) acts_as_indexed (~> 0.8.0) friendly_id (~> 5.1.0) globalize (>= 4.0.0, < 5.2) refinerycms-core (~> 3.0.0) refinerycms-settings (~> 3.0.0)

GIT remote: https://github.com/refinery/refinerycms-page-images revision: 9b5f16e8266cb3c823c4d310ec3e733245258dde branch: master specs: refinerycms-page-images (3.0.0) decorators (~> 2.0.0) globalize (~> 5.0) refinerycms-pages (~> 3.0.0)

GEM remote: https://ruby.taobao.org/ specs: actionmailer (4.2.4) actionpack (= 4.2.4) actionview (= 4.2.4) activejob (= 4.2.4) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) actionpack (4.2.4) actionview (= 4.2.4) activesupport (= 4.2.4) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) actionview (4.2.4) activesupport (= 4.2.4) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) activejob (4.2.4) activesupport (= 4.2.4) globalid (>= 0.3.0) activemodel (4.2.4) activesupport (= 4.2.4) builder (~> 3.1) activerecord (4.2.4) activemodel (= 4.2.4) activesupport (= 4.2.4) arel (~> 6.0) activesupport (4.2.4) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) acts_as_indexed (0.8.3) addressable (2.3.8) arel (6.0.3) awesome_nested_set (3.0.2) activerecord (>= 4.0.0, < 5) babosa (1.0.2) bcrypt (3.1.10) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) builder (3.2.2) byebug (6.0.2) coffee-rails (4.1.0) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.0) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.9.1.1) debug_inspector (0.0.2) decorators (2.0.1) railties (>= 4.0.0, < 5.0.0) devise (3.5.2) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) responders thread_safe (~> 0.1) warden (~> 1.2.3) dragonfly (1.0.12) addressable (~> 2.3) multi_json (~> 1.0) rack (>= 1.3.0) erubis (2.7.0) execjs (2.6.0) friendly_id (5.1.0) activerecord (>= 4.0.0) globalid (0.3.6) activesupport (>= 4.1.0) globalize (5.0.1) activemodel (>= 4.2.0, < 4.3) activerecord (>= 4.2.0, < 4.3) i18n (0.7.0) jbuilder (2.3.1) activesupport (>= 3.0.0, < 5) multi_json (~> 1.2) jquery-rails (4.0.5) rails-dom-testing (~> 1.0) railties (>= 4.2.0) thor (>= 0.14, < 2.0) jquery-ui-rails (5.0.5) railties (>= 3.2.16) json (1.8.3) loofah (2.0.3) nokogiri (>= 1.5.9) mail (2.6.3) mime-types (>= 1.16, < 3) mime-types (2.6.2) mini_portile (0.6.2) minitest (5.8.0) multi_json (1.11.2) nokogiri (1.6.6.2) mini_portile (~> 0.6.0) orm_adapter (0.5.0) quiet_assets (1.1.0) railties (>= 3.1, < 5.0) rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) rails (4.2.4) actionmailer (= 4.2.4) actionpack (= 4.2.4) actionview (= 4.2.4) activejob (= 4.2.4) activemodel (= 4.2.4) activerecord (= 4.2.4) activesupport (= 4.2.4) bundler (>= 1.3.0, < 2.0) railties (= 4.2.4) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) rails-dom-testing (1.0.7) activesupport (>= 4.2.0.beta, < 5.0) nokogiri (~> 1.6.0) rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.2) loofah (~> 2.0) rails-i18n (4.0.5) i18n (~> 0.6) railties (~> 4.0) railties (4.2.4) actionpack (= 4.2.4) activesupport (= 4.2.4) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (10.4.2) rdoc (4.2.0) refinerycms-acts-as-indexed (2.0.1) acts_as_indexed (~> 0.8.0) decorators (~> 2.0.0) refinerycms-core (~> 3.0.0) refinerycms-authentication-devise (1.0.4) actionmailer (~> 4.2, >= 4.2.0) devise (~> 3.0, >= 3.2.4) friendly_id (~> 5.1.0) refinerycms-core (~> 3.0, >= 3.0.0) refinerycms-i18n (3.0.1) rails-i18n (~> 4.0.1) routing-filter (>= 0.4.0) refinerycms-settings (3.0.0) friendly_id (~> 5.0, >= 5.0.1) refinerycms-core (~> 3.0, >= 3.0.0) refinerycms-wymeditor (1.0.6) refinerycms-core (~> 3.0, >= 3.0.0) responders (2.1.0) railties (>= 4.2.0, < 5) routing-filter (0.5.1) actionpack (~> 4.2) activesupport (~> 4.2) sass (3.4.18) sass-rails (5.0.4) railties (>= 4.0.0, < 5.0) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) seo_meta (2.0.0.rc.1) railties (>= 3.0.0) speakingurl-rails (1.1.5) railties (>= 3.1) spring (1.4.0) sprockets (3.3.4) rack (~> 1.0) sprockets-rails (2.3.3) actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) sqlite3 (1.3.10) thor (0.19.1) thread_safe (0.3.5) tilt (2.0.1) truncate_html (0.9.3) turbolinks (2.5.3) coffee-rails tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (2.7.2) execjs (>= 0.3.0) json (>= 1.8.0) warden (1.2.3) rack (>= 1.0) web-console (2.2.1) activemodel (>= 4.0) binding_of_caller (>= 0.7.2) railties (>= 4.0) sprockets-rails (>= 2.0, < 4.0) will_paginate (3.0.7) zilch-authorisation (0.0.1)

PLATFORMS ruby

DEPENDENCIES byebug coffee-rails (~> 4.1.0) jbuilder (~> 2.0) jquery-rails quiet_assets rails (= 4.2.4) refinerycms! refinerycms-acts-as-indexed (~> 2.0, >= 2.0.0) refinerycms-authentication-devise (~> 1.0) refinerycms-news! refinerycms-page-images! refinerycms-products! refinerycms-wymeditor (~> 1.0, >= 1.0.6) sass-rails (~> 5.0) sdoc (~> 0.4.0) spring sqlite3 turbolinks uglifier (>= 1.3.0) web-console (~> 2.0)

BUNDLED WITH 1.10.6

zmdroid commented 9 years ago

Hi, open url : 127.0.0.1:3000/refinery/shop/products is error SELECT DISTINCT "refinery_products"."id" FROM "refinery_products" LEFT OUTER JOIN "refinery_product_translations" ON "refinery_product_translations"."refinery_product_id" = "refinery_products"."id" ORDER BY refinery_product_translations.title, updated_at DESC LIMIT 10 OFFSET 0 error is : ORDER BY refinery_product_translations.title, updated_at DESC LIMIT 10 OFFSET 0 modify : ORDER BY refinery_product_translations.title, refinery_product_translations.updated_at DESC LIMIT 10 OFFSET 0 is ok

i find this file: /app/controllers/refinery/products/products_controller.rb crudify :'refinery/products/product', :order => 'updated_at DESC', :include => [:translations] delete :order=> 'updated_at DESC' is ok

bricesanchez commented 9 years ago

Thanks, i will check this soon :)

bricesanchez commented 9 years ago

Thanks #13