Re: [Rails] Rails 5.2 Active storage Unable to autoload constant ActiveStorage::Blob::Analyzable

2018-06-12 Thread Skt Hg
Replying to myself in case someone hits the same issue. First thanks Frank for the pointers you sent me. I am new to rails so it was very helpful to debug from a clean state. I got to solve it, the main issue for me was a parsing error in the ‘storage.yml’ file. The storage engine was chocking

Re: [Rails] Rails 5.2 Active storage Unable to autoload constant ActiveStorage::Blob::Analyzable

2018-06-12 Thread Skt Hg
Hi Frantz I have an issue similar to Mattia's, so I tried your suggestion. Thanks for the advice, although installing mini_magick (v4.8) didn't solve the issue for me. For context, I'm on ruby 2.4.2 / rails 5.2 / active storage 5.2 I followed this tutorial for the active storage setup http://edg

[Rails] Re: There must be a more elegant way to do this

2011-06-04 Thread skt
On Jun 4, 12:57 am, Colin Law wrote: > On 3 June 2011 17:49, skt wrote: > > > Hello, > > > I have a bunch of arrays containing records retrieved from the > > database in separate queries. That can't be changed - I have deal with > > the different arrays o

[Rails] Re: There must be a more elegant way to do this

2011-06-03 Thread skt
On Jun 3, 1:39 pm, Valery Kvon wrote: > Well, that's other one task and not just .uniq. Magic unuseful :) > > You'd better to write much more complex clause: > > (array1 + array2 + arrayN).group_by { |instance| [instance.user_id, > address_id] }.values.collect { |array| array.sort {|a,b| a.dist

[Rails] Re: There must be a more elegant way to do this

2011-06-03 Thread skt
es of models all the time - it's a very handy > > tool. > > Agreed, but it doesn't solve the problem when you only want unique instances > based on *some* of the fields. > > > > Sounds like skt wants to consider an instance unique based on only two > > >

[Rails] Re: There must be a more elegant way to do this

2011-06-03 Thread skt
Thanks Michael and Tim. On Jun 3, 11:19 am, Tim Shaffer wrote: > I think the problem with doing that is that the arrays contain instances of > models. > > Sounds like skt wants to consider an instance unique based on only two > attributes of each instance. That's correct T

[Rails] There must be a more elegant way to do this

2011-06-03 Thread skt
Hello, I have a bunch of arrays containing records retrieved from the database in separate queries. That can't be changed - I have deal with the different arrays of these records. Each of these records contains, amongst other data fields, two ids - a user_id and an address_id. Now my task is to t

[Rails] Re: Not getting all data fields from Rails query

2011-06-02 Thread skt
be able to view all fields in a nice formatted table) > > Hope it helps. > -Jazmin > > > > > > > > > > On Thu, Jun 2, 2011 at 9:02 PM, skt wrote: > > Hello, > > > I am trying to get specific fields returned from my query but I am not > > ge

[Rails] Not getting all data fields from Rails query

2011-06-02 Thread skt
Hello, I am trying to get specific fields returned from my query but I am not getting some of them. For example when I use User.joins(:books).select("users.email, users.fname, books.name").find(7) The generated SQL Query from above code is SELECT users.email, users.fname, books.name FROM users

[Rails] Re: Application Error!!!!!!!!!!!!!!!!!!!!!!!

2011-06-02 Thread skt
This is has been pointed out above but to be sure - You are probably using paperclip to upload files and Heroku doesn't allow that. You need to store that on S3 or some place other than Heroku. Local file upload works which is why you are not seeing an issue there. On Jun 2, 4:15 pm, Jim Ruther N

[Rails] Re: Geokit query with multiple models involved

2011-05-30 Thread skt
Figured it out Store.joins(:books, :addresses).where("books.isbn = '9780316346627'").within(5, :origin => @addr) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To u

[Rails] Geokit query with multiple models involved

2011-05-30 Thread skt
Hello, My database structure consists of Store, Book, BookStore and Address as below. class Store < ActiveRecord::Base has_many :book_stores has_many :books, :through => :book_stores has_many :addresses acts_as_mappable :through => :addresses end class Address < ActiveRecord::Base bel

[Rails] Re: accepts_nested_attributes_for and _destroy not working (but no error messages)

2011-04-14 Thread skt
Couple things you can try - 1. Where you have _destroy="false" replace that with _destroy="0" - just in case something is throwing that parser out of whack 2. Try _delete instead of _destroy - been a while but I remember in one of my setups _delete worked but not _destroy -S On Apr 14, 10:42 pm,

[Rails] Re: Routing error with OmniAuth

2011-04-14 Thread skt
On Apr 14, 7:28 pm, Phil Crissman wrote: > Phil > > > > > > > > > > On Thu, Apr 14, 2011 at 6:29 PM, skt wrote: > > Hello, > > > I am trying to use OmniAuth with Devise and I am stumbling on some > > initial step. When I go to localhos

[Rails] Routing error with OmniAuth

2011-04-14 Thread skt
Hello, I am trying to use OmniAuth with Devise and I am stumbling on some initial step. When I go to localhost:3000/auth/twitter I get a routing error No route matches "/auth/twitter" I have the "gem omniauth" in my gemfile and I have omniauth.rb where I have setup twitter connection as below R

[Rails] Starting rails server on 3.0.5 gives Psych::SyntaxError - Parsing YAML

2011-04-02 Thread skt
Hello, I just updated to using Rails 3.0.5 and was on Ruby 1.9.2p0 but replaced that with 1.9.2p180 to try and get the over problem below but am unable to. After creating a new project and adding a few gems to Gemfile and bundle install (and update to make sure) when I try to start the server with

[Rails] Re: Rails guides has_many :through example

2011-03-01 Thread skt
On Mar 1, 11:13 pm, zindelo wrote: > Sorry I didn't add the patients in there, but I would need the three tables. > What I'm after is how to represent this data in a form. There is a ton of > info out there about associations, but not much related to using the data in > a join table like the app

[Rails] Re: Rails guides has_many :through example

2011-03-01 Thread skt
What are you trying to accomplish here? has_many :through setup requires three tables. In this case it seems all you need is physician has_many appointments. class Physician < ActiveRecord::Base has_many :appointments end class Appointment < ActiveRecord::Base belongs_to :physician end And

[Rails] polymorphic_path not getting generated

2011-03-01 Thread skt
Folks, I am trying to use the Savage Beast plugin in a polymorphic way. I have setup my model as below # Leaving out other details from models class Forum < ActiveRecord::Base has_one :recent_topic, :class_name => 'Topic', :order => 'sticky desc, replied_at desc' belongs_to :forum_owner, :po

[Rails] adding discussion forum to app

2011-02-23 Thread skt
Folks, I am looking around for the best way to add discussion forums to my application. The application will be used by couple schools each of which has many grades and each grade can have many sections and each of the sections needs a forum of its own. School---has_many> grades

[Rails] Re: Multiple roles of a user with STI

2011-01-18 Thread skt
On Jan 18, 6:43 pm, Marnen Laibow-Koser wrote: > Matt Jones wrote in post #975916: > > > > > > > > > > > On Jan 18, 6:45pm, skt wrote: > > >> # relationships and functionality to work on students and grades etc > >> end > > >

[Rails] Multiple roles of a user with STI

2011-01-18 Thread skt
Folks, I have setup Single Table Inheritance with my User model. Now the user can have multiple roles. In my situation (a school app) the user can be a Teacher (through which I want to access the students, grades etc) and the same user can also be a Parent (through which I want to access the child

[Rails] Re: has_many :through with Single Table inheritance

2011-01-18 Thread skt
On Jan 17, 9:30 am, skt wrote: > On Jan 15, 8:34 am, Matt Jones wrote: > > > > > > > > > > > On Jan 14, 7:49 pm,skt wrote: > > > > I have the following model structure setup. > > > > class User < ActiveRecord::Base > >

[Rails] Re: has_many :through with Single Table inheritance

2011-01-17 Thread skt
On Jan 15, 8:34 am, Matt Jones wrote: > On Jan 14, 7:49 pm,skt wrote: > > > > > > > > > > > I have the following model structure setup. > > > class User < ActiveRecord::Base > > end > > > class Parent &l

[Rails] has_many :through with Single Table inheritance

2011-01-14 Thread skt
I have the following model structure setup. class User < ActiveRecord::Base end class Parent < User has_many :relationships has_many :children, :class_name => "Student", :through => :relationships, :conditions => "related_as = 'parent'" end cla

[Rails] Paperclip custom Interpolation in url

2011-01-07 Thread skt
Folks, I have a simple model hierarchy (reduced to example as below) class Post < ActiveRecord::Base has_many :comments end class Comment < ActiveRecord::Base belongs_to :post has_attached_file :photo, # :url => "/assets/class_cal//:id/:style/:basename.:extension" :url =>

[Rails] Error creating model object using accepts_nested_attributes_for

2010-11-28 Thread skt
Folks, I am on Rails 2.3.8. I have models declared as below class GradeSection < ActiveRecord::Base has_many :class_calendars end class ClassCalendar < ActiveRecord::Base has_many :uploaded_attachments, :class_name => 'UploadedAttachment' accepts_nested_attributes_for :uploaded_attachm

[Rails] Re: querying has_many relationships

2010-11-28 Thread skt
I suspect department.courses returns and array and when you print it out you get the address of the first entry in the array. That would also explain department.courses.course_name would fail because you have to index into the department.courses array like department.courses[x].course_name to be a

[Rails] Re: Errors when freezing rails

2009-04-17 Thread skt
; c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31 c:/r

[Rails] Errors when freezing rails

2009-04-17 Thread skt
Folks, I am trying to freeze rails but am running into some errors that I don't understand. I have tried couple ways based on results I got from searching on the web as below. I thought freezing rails would be a simple and quick thing but am stuck here. Any thoughts on what I may be doing wrong?

[Rails] Can't get an Array function to be visible inside ApplicationHelper

2009-04-11 Thread skt
Folks, I seem to be missing something basic here. I am trying to call a function from my application layout that will return me a hash of the roles for the user currently signed in. Here is the simplified code I have in ApplicationHelper module class Array def to_h Hash[*enum_with_i

[Rails] Re: Modifying output from to_json to exclude table name

2009-03-05 Thread skt
Figured it out. Have to set ActiveRecord::Base.include_root_in_json = false On Mar 5, 3:00 pm, skt wrote: > Folks, > > I have a Meal model and Model.find(:all).to_json returns the following > > [{"meal": {"name": "Veggies Lasagna", "id&

[Rails] Modifying output from to_json to exclude table name

2009-03-05 Thread skt
Folks, I have a Meal model and Model.find(:all).to_json returns the following [{"meal": {"name": "Veggies Lasagna", "id": 1}}, {"meal": {"name": "Chicken Rice", "id": 2}}, {"meal": {"name": "Noodle Rice", "id": 3}}] What I want to do is not have the table name (meal) be part of the output json