sheeny

Activity Graph

Page 1 of 3 | Next »

2016-01-21

[22:24:30] sheeny: has joined #RubyOnRails
[22:37:18] sheeny: Could anyone explain why having a port in action mailer from returns a string rather than an array? https://gist.github.com/craigsheen/aab578ce85700626e909
[22:40:00] sheeny: matthewd: ah ok, cool thanks
[22:41:12] sheeny: Quit: Page closed

2016-01-20

[08:58:08] sheeny: has joined #RubyOnRails
[09:00:58] sheeny: Hi, Can I use ENV vars in yml files?
[09:01:23] sheeny: I have tried `<%= ENV['blah'] %> but it doesnt seem to be working
[09:01:46] sheeny: If that is correct then maybe its the gem im using
[09:02:27] sheeny: its a custom one, im using a settings file basically
[09:02:47] sheeny: using https://github.com/redbubble/key-vault
[09:03:30] sheeny: makes sense
[09:06:03] sheeny: YAML.load(ERB.new(IO.read(Rails.root + "config/key_vault.yml")).result).symbolize_keys works a charm - cheers ill make a PR
[09:06:04] sheeny: thanks :)
[09:07:32] sheeny: Quit: Page closed

2015-09-14

[11:45:38] sheeny: has joined #RubyOnRails
[11:46:52] sheeny: Hi all, I am having a problem with assets with rails 4.2.4, whenever I deploy, my assets dont get updated, I can see the changes on the files in the server but if i check the compiled css it hasnt been updated. Is there any known issues?
[12:00:30] sheeny: I tried going on to the server and doing that but it didnt make any difference
[12:02:58] sheeny: hmm i could try that
[12:13:27] sheeny: Quit: Page closed

2015-08-05

[08:30:31] sheeny: has joined #ruby
[08:32:38] sheeny: Hi all, I have a rails project which connects to an external database (i dont have control over the column names/data) unfortunately the column names are all upcase, so when i try object.attribute it obviously raises method missing, where object['ATTRIBUTE'] would work. I am considering overriding method missing to handle this but before I do i was wondering if anyone had a better cleaner solution?
[08:33:37] sheeny: has left #ruby: ()
[08:33:59] sheeny: has joined #RubyOnRails
[08:34:07] sheeny: Hi all, I have a rails project which connects to an external database (i dont have control over the column names/data) unfortunately the column names are all upcase, so when i try object.attribute it obviously raises method missing, where object['ATTRIBUTE'] would work. I am considering overriding method missing to handle this but before I do i was wondering if anyone had a better cleaner solution?
[08:46:44] sheeny: Ah i see there is a 'lowercase_schema_reflection' option for SQL, the only problem is I am forced to use SQLAnywhere so it could be more interesting, but i will take a look
[08:59:23] sheeny: Quit: Page closed

2015-07-29

[07:14:57] sheeny: has joined #ruby
[07:15:43] sheeny: Hi all, just wondering if someone would be able to help with this? https://gist.github.com/anonymous/cd1be79c47a65fee1da4
[07:19:34] sheeny: ljarvis: awesome thanks
[07:20:32] sheeny: Quit: Page closed

2015-06-19

[10:25:52] sheeny: has joined #ruby
[10:26:33] sheeny: Hi, would anybody be able to explain to my why inject gives me this? https://gist.github.com/anonymous/43b4dc8780b61253b7d9
[10:29:56] sheeny: ccooke: ah yes thank you :)
[10:31:10] sheeny: thanks everyone that website makes more sense.. guess I just wasnt expecting that haha! much appreciated :)
[10:32:13] sheeny: Ox0dea: Thanks ill take a look
[10:33:02] sheeny: yeah It's for a project which I inherited, i would have prefered everything stored in pence/cents but hey ho
[10:34:43] sheeny: thanks :)
[10:45:16] sheeny: Quit: Page closed

2015-03-19

[10:48:29] sheeny: Does anyone know if there is any issues with form_for in the newer rails? For some reason at a certain stage of my app I get an error as it thinks that 'ActionView::Helpers::FormBuilder' responds to constantize which it shouldn't I dont think..
[10:53:54] sheeny: https://gist.github.com/craigsheen/66d863c67c115d656477
[10:56:13] sheeny: updated :)
[10:56:57] sheeny: I can see the issue.. it thinks it can constantize builder but it can't so the error is that its not passing through anything to the constantize method
[10:57:08] sheeny: i just dont know why
[10:57:47] sheeny: universa1: https://gist.github.com/craigsheen/66d863c67c115d656477#file-gistfile2-haml-L1
[10:57:49] sheeny: that line
[11:06:36] sheeny: mikecmpbll: class
[11:07:11] sheeny: universa1 mikecmpbll i seem to have found the issue, it's saying the issue is with that line but if i comment a line a bit further above out it starts working
[11:07:39] sheeny: mikecmpbll: its a helper which builds an array of arrays
[11:20:32] sheeny: mikecmpbll: Thank you! it was because in a class i was calling I was including ActiveSupport inflector and it must have been screwing something up
[11:20:47] sheeny: not sure why i was including it mind..

2015-03-10

[16:31:30] sheeny: Hi, has anyone had this issue with Rails 4? https://gist.github.com/anonymous/ab616a2e7a8228ed560f
[16:35:33] sheeny: bricker: https://gist.github.com/craigsheen/3d99679261e701f5a4bb
[16:38:23] sheeny: bricker: is that not just the path of the file with the slashes exchanged for underscores? looks like the rest of the stack follows that format
[16:39:32] sheeny: bricker the line it's pointing to is what is pasted at the top of the gitst
[16:40:51] sheeny: bricker: looking at the trace its failing on the constantize method, ill dig in and have a look why

2015-02-23

[11:55:43] sheeny: Could anyway help me with this? not entirely sure what to search for to find a solution. https://gist.github.com/anonymous/3e95398503f7a8247975 I have a list of keys which I want to use to build some params for a method kind of..
[12:15:33] sheeny: shayolden: rvm --default use 2.2.0

2015-02-01

[16:29:18] sheeny: Hi, does anyone know a way of determining if a colour is "light" or "dark" ?
[16:33:32] sheeny: knut: thanks
[16:37:24] sheeny: knut: ah great! good place to start thanks again

2015-01-28

[14:42:18] sheeny: Is there a ruby or rails method to get percentage off a number?
[14:44:07] sheeny: i know the maths behind it and i know how to work it out
[14:45:15] sheeny: rvanlieshout: 5?.. i mean something like ... 20.percentage_off(10) would give me 10% off 20
[14:46:06] sheeny: no the answer.. 20.percentage_off(10) => 18
[14:46:48] sheeny: i just wondered if there was a method that existed :)
[14:47:50] sheeny: its not the maths that is the issue here, it's more the ease of having to type it

2015-01-22

[09:45:03] sheeny: are the models STI or completely separate?
[09:47:25] sheeny: You should be able to paginate on an array anyway, you using Kaminari or Will paginate?
[09:49:50] sheeny: https://github.com/amatsuda/kaminari#paginating-a-generic-array-object
[09:52:12] sheeny: the trouble with that is the paginate wont know how many to select from the 2 different tables so not sure there would be any other way to do that
[09:54:32] sheeny: Could anyway let me know if its possible to get the output from a ruby script in a rake task into a variable? https://gist.github.com/anonymous/54117cad85e302832034
[09:58:37] sheeny: is there not a way to get the last line of text? i just need to check what it says

2014-12-29

[11:13:02] sheeny: Hi all, does anyone know how to make paperclip give me the full path to the missing image if the image is null? url works but i need the full path as it's an API

2014-12-11

[10:03:01] sheeny: Hi all, Im trying to unique by an attribute but it doesn't seem to be working.. is this the correct way to achieve this? https://gist.github.com/craigsheen/d09648844d190567cfdf

2014-10-13

[18:11:31] sheeny: Hi all, I am creating a Rails api and a couple of apps that need to connect to it. I need to include user log in. I have looked at Devise but I see they have removed token auth. Is there a best practice way to do this? can anyone point me towards a blog post/gem?
[18:14:05] sheeny: Sombrio: devise removed it in their latest version

2014-09-23

[11:03:38] sheeny: Hi all, Does anyone know if, in Delayed Job, in a custom job class there is a way to access the job instance? I need to get hold of the attempts etc.

2014-08-18

[09:14:39] sheeny: Hi all.. I am getting a byte array for a PDF back from a web service and I need to output this as a pdf to a user but not save the file. What's the best way to do this? I've looked at wicked_pdf but there doesn't seem to be a way to pass a byte array to it
[12:33:03] sheeny: Hi all, I'm trying to output a pdf file from a byte array I am being passed but I can't seem to get it working. I have tried writing the bytes to a file but not having any luck. Could anyone point me in the right direction of how to do this in ruby? Byte array looks like "JVBERi0xLjMNC..."
[12:46:05] sheeny: Hi, anyone know how to write a byte array to a file to make a pdf? It keeps failing but I can't quite tell if its the byte array or just my code, If I open and read another pdf it works but when i try with the byte array I am passed it doesnt work. The byte array looks like this: "JVBERi0xLjMNC..."

2014-07-31

[11:49:47] sheeny: Hi, I am using paperclip for my images. We get the original image and create various versions of this image. The original image has copyright information in the 'IPTC', the paperclip converted images do not have these. Does anyone have a way I can copy these across?

2014-03-31

[15:04:43] sheeny: Hi all, is there a way to initialize a hash if its nil while merging? with just creating a blank hash? so doing session["something"].merge({"a" => "b"}) would create the session if its nil
[15:05:52] sheeny: without just doing session["something"] = {} unless session["something"]
[15:08:10] sheeny: EminenceHC: im doing that at the moment, was just wondering if there was a nicer way.. like a magic method merge_or_initialize or something random

2014-03-06

[13:00:00] sheeny: Hi all, is it possible to send a file upload(image) through an API using ActiveResource.. I have read on the api.rubyonrails.org and it does pass the image as an actiondispatch but this is a string.. I was just wondering how I get access to this?

2014-01-27

[09:44:01] sheeny: Hi all, monday morning problem I presume but could someone point me in the direction of what I am doing wrong here? https://gist.github.com/craigsheen/8645739
[09:47:38] sheeny: certainty: updated
[09:48:54] sheeny: certainty: ahhhh spotted it now you said that!
[09:49:00] sheeny: certainty: thanks silly mistake!! haha
[09:49:07] sheeny: ljarvis: thanks :)

2014-01-08

[16:08:07] sheeny: hi all, is there a simple way to extract key/values (space seperated) from a string without having to regex it etc.? example string: https://gist.github.com/craigsheen/8319198
[16:11:41] sheeny: universa1: the values can have spaces too though, as shown in the example.. sorry should have probably made that more clear
[16:13:23] sheeny: universa1: lovely.. gotta love third party stuff.. ill have to go the regex route
[16:14:08] sheeny: universa1: thats an example from what can be returned. That's what I am going off
[16:15:23] sheeny: universa1: ha quite possibly.. the keys should be characters followed by =
[16:16:38] sheeny: universa1: Dont know why they return it this way.. its not the best. But will do that. Thanks for your help

2013-11-05

[15:09:49] sheeny: Hi all, is there a way to break out of an iframe when doing a redirect_to in a controller?
[15:10:08] sheeny: without posting some horrible javascript back to do it..
[15:13:07] sheeny: workmad3 so that would help with the issue? there is no way I can get around the iframe, as its used for payment and im just handling the postback
[15:14:36] sheeny: workmad3: ah cool ta
[15:15:20] sheeny: workmad3: ill take a look thanks

2013-09-26

[08:50:06] sheeny: Hi all, Not sure if this is possible for me to do with code or if its just an issue.. I have an online file system, people upload documents, when they upload a .docx file it tries to download as a .zip file. I know a docx is a zipped doc file. but is there anyway i can make it understand what it is?
[08:51:33] sheeny: defswork: i tried adding a mime type for it
[08:52:43] sheeny: defswork: just using paperclip to upload files which are stored in s3
[08:53:43] sheeny: defswork: ah maybe that is the issue.. just checked the file type and it says zip
[08:53:56] sheeny: defswork: so maybe paperclip doesnt understand my mime
[08:55:33] sheeny: defswork: So paperclip doesnt understand it? i thought it would realise the document type and save that in its "type" column?
[08:57:04] sheeny: defswork: ah okay, makes sense then i guess. So if i check the file myself and overwrite the type then go that way?
[09:02:18] sheeny: defswork: hmm it doesnt seem to be an issue with that. i have changed the type forcefully but the error persists, im not thinking it must be to do with S3 as that is where the file is coming from
[13:50:26] sheeny: whois dopie
[13:50:35] sheeny: redactor?
[13:50:41] sheeny: is that a WYSIWYG?
[13:50:51] sheeny: then no :(
[13:51:18] sheeny: you dont use it to drag on drop stuff do you?
[14:57:44] sheeny: amarraja: if something render "something" else render "something" end
[15:02:28] sheeny: amarraja: if you put 'super' at the top of the method and then just try putting render "something" and return that should work i think.. unless i think you can use return on renders
[15:05:40] sheeny: amarraja: oh hmm
[15:08:54] sheeny: amarraja: ah okay, it seems you need to just specify the layout.. like.. http://stackoverflow.com/questions/4412018/rails-devise-how-to-render-login-page-without-a-layout
[15:09:08] sheeny: amarraja: so you would have layout :layout then a layout method which has that logic in it
[15:11:41] sheeny: amarraja: yep

2013-09-25

[12:24:21] sheeny: Hi all, bit of a strange question..SEO guy has complained as pages with and without / at the end are being indexed.. basically he wants me to cut off any request with a / at the end and 301 redirect.. i know how to do the redirect but how would i even catch that?
[12:25:59] sheeny: at the moment i do catch some in routes and figure some out from there (there were old pages) however don't routes then only pass through as params and therefore dont have any slashes at all?
[12:26:02] sheeny: ljarvis: haha!
[12:27:18] sheeny: ljarvis: god knows :( there is a SO about it which says to do 301 redirects.. http://webmasters.stackexchange.com/questions/46726/google-indexed-urls-both-w-or-w-o-trailing-slash
[12:28:43] sheeny: pskrz: ah that look somewhere along the right lines, seems massive overkill for something so stupid but thats SEO people for you..
[12:29:18] sheeny: ljarvis: thanks will make sure the canonical is added too
[12:30:13] sheeny: pskrz: Unfortunately when SEO people get involved it will never happen :(

2013-09-24

[08:02:14] sheeny: Does anyone know what this error is all about? https://gist.github.com/craigsheen/6681695
[08:02:34] sheeny: Was working perfectly fine a couple of days ago
[08:05:45] sheeny: Ah nvm, its on OSX issue with files, maybe I changed something the other day

2013-09-12

[08:34:21] sheeny: When you output a file from within the respond_to is there a generic way to name the file which is exported?
[08:37:41] sheeny: defswork: no just normal respond to a different format
[08:40:52] sheeny: defswork workmad3 https://gist.github.com/craigsheen/6534559
[08:45:49] sheeny: defswork workmad3 ah figured it out, you were right with the headers
[08:46:16] sheeny: defswork: thanks
[08:49:25] sheeny: defswork: https://gist.github.com/craigsheen/6534632
[08:53:30] sheeny: defswork: haha yeah, i tried alsorts, I guess its one of them things when you know what your looking for its simple
[08:54:10] sheeny: workmad3: ive tried within writeexcel it doesnt work. rails seems to take over and rename it how it things
[08:55:19] sheeny: workmad3: oh there is a class that comes from the gem
[08:56:01] sheeny: workmad3: there is actually a bit in the docs that tell you that you can rename a workbook but as above it doesnt work. not sure if its because of the rails version im using or what
[08:56:19] sheeny: writeexcel...
[08:56:59] sheeny: workmad3: its in the docs somewhere
[08:57:49] sheeny: workmad3: maybe i got it from rails casts or something
[08:57:51] sheeny: workmad3: https://gist.github.com/craigsheen/6534710
[08:57:58] sheeny: workmad3: thats what you add
[08:59:37] sheeny: workmad3: i cant find where i actually got it from now, it came from somewhere lol
[09:00:49] sheeny: defswork: (Y)
[09:03:16] sheeny: dont think so, in the docs it says it stores the worksheet data into temp files prior to assembling the workbook
[09:09:21] sheeny: defswork: yeah true
[09:40:35] sheeny: Could anyone help me with my cap recipe? When I try to deploy im get "Killed" when it tries to compile the assets. however i can ssh onto the vm and run the compile command and it works fine. Im using rails4 for the record.
[09:41:56] sheeny: mikecmpbll: it worked though after
[09:42:23] sheeny: mikecmpbll: though i did forget about the memory thing
[09:42:25] sheeny: mikecmpbll: thanks haha
[09:42:31] sheeny: mikecmpbll: ill get someone to up it
[09:43:36] sheeny: mikecmpbll: should be fine to up it :) just need to get who looks after the servers to do it, and he is slow :( lol

2013-09-11

[07:40:55] sheeny: Could anyone give me a hand with capistrano and rails 4? when I do cap deploy it tries to compile and then complains that there is no manifest.yml file, now I was brought to believe rails4 doesnt use a .yml one? if i add a blank one in it causes issues with other gems
[09:57:08] sheeny: How do I merge params into a .xls link_to ? so i have a report and i want to export it (this works fine) however i need to pass in the current params[:search] into the link.. so i know i can do link_to "blah", path(params[:search]) which works fine but if i add format: "xls" the params arent passed
[09:57:19] sheeny: is there a way of doing it without specifying each param?
[09:59:53] sheeny: universa1 workmad3 ah thanks both :)
[10:06:54] sheeny: hmm on that params issue.. its not then nesting properly
[10:07:18] sheeny: so if i do as you said instead of getting params[:search][:something] im just getting params[:something]
[10:09:00] sheeny: ah nvm i just pass params in
[15:58:36] sheeny: Is there a way I can specify that a route can respond to a different format? so resources :reports.. i need to have that respond to html and xls

2013-09-10

[13:21:03] sheeny: Anyone know why this is happening? ** Execute environment ** Execute assets:precompile Killed
[13:21:12] sheeny: Thats the trace from my precompile assets
[13:21:50] sheeny: it fails with capistrano so i have sshed onto my box
[13:21:55] sheeny: and run it on there
[13:22:07] sheeny: is there anyway to test that?
[13:22:48] sheeny: seems to be plenty free
[13:23:07] sheeny: used: 539 free: 462
[13:26:59] sheeny: hmm if i dont do --trace it just seems to be stuck.. the memory does get quite low
[13:34:15] sheeny: Has anyone successfully compiled with tinymce before?
[15:50:48] sheeny: Does anyone know of any formatting text areas (i.e. ckeditor, tinymce) that actually works with rails4 and compiles properly?

2013-09-05

[07:16:15] sheeny: echosystm: resources :models, only: [:show, :update] ?
[07:16:25] sheeny: would give you 2 routes though
[07:16:49] sheeny: that would give you 2 routes though
[07:43:06] sheeny: jeoiny: if people arent answering thee is probably a reason. It is pretty difficult to get a really good regex for a website. Have you tried googling it? there are plenty of websites with regex for different things on them
[12:57:02] sheeny: Criten: what about User.create(whatever you need).role? :admin
[12:57:26] sheeny: Criten: i.e. is it doing something on create
[12:57:40] sheeny: Criten: also whats in your ability file
[13:03:30] sheeny: Criten: yeah i agree with workmad3 try logging out and clear cache and see what happens
[13:04:12] sheeny: Criten: hmm
[13:05:32] sheeny: dllama: it should tell you
[13:40:33] sheeny: dllama: well it tells you the issue, your passing it params when it expects a credential. the issue is 'simple_fields_for 'shipping_provider[credential][details]'' bit
[13:46:41] sheeny: dllama: you cant do that

2013-09-04

[09:12:42] sheeny: Does anyone have any suggestions as to why my error pages arent showing on my production server? when i hit an error it just shows a blank page, no source code or anything on it but the error is appearing in the logs. (I am using Better errors, could this be why?)
[11:51:09] sheeny: msg NickServ identify password
[14:21:48] sheeny: creature: damn just beat me to it
[14:23:13] sheeny: RobW_: depends on the version i think
[14:25:31] sheeny: RobW_: when you have ran bundle if you go to your Gemfile.lock you can see in there
[14:34:03] sheeny: blackmesa: if it is then god help us all
[14:59:43] sheeny: gerep: whats wrong with that?
[15:00:57] sheeny: gerep: what your doing it fine, your not accessing it directly
[15:02:24] sheeny: gerep tubbo as he said :)
[15:02:47] sheeny: gerep: the only way it could be improved is if you preload the transactions maybe
[15:07:26] sheeny: its not needed really, would just cut out some db queries
[15:08:16] sheeny: well you could go that far haha
[15:08:40] sheeny: gerep: you would need a where for the pending part though
[15:09:08] sheeny: this escalated very quickly from a basic question haha
[15:13:17] sheeny: gerep: if you are using rails4 you will need to put .references(:transactions)
[15:13:19] sheeny: at the end
[15:13:50] sheeny: gerep: then ignore that :)
[15:17:58] sheeny: starfox21: specific
[15:24:35] sheeny: no need for precompiling assets then as capistrano does it
[15:24:55] sheeny: unless your using an old one
[15:26:26] sheeny: workmad3: it does it automatically on the newer versions
[15:27:09] sheeny: mine does it, did it yesterday
[15:43:46] sheeny: stef1a_: I had this issue yesterday, on your remote machine if you do "which bundle" it will tell you were it is
[15:44:13] sheeny: stef1a_: then i have a line to set the environment
[15:45:24] sheeny: stef1a_: do you have a line like: "set :default_environment" in your deploy.rb file?
[15:47:00] sheeny: stef1a_: try adding this line; set :default_environment, { 'PATH' => "/home/app/.rvm/gems/ruby-2.0.0-p247/bin:$PATH" }
[15:47:38] sheeny: stef1a_: basically that issue is when capistrano doesnt know where to find bundler
[15:49:43] sheeny: stef1a_: can you bundle on the remote machine itself?
[15:49:51] sheeny: stef1a_: or do you not have access?
[15:50:29] sheeny: stef1a_: shouldnt really make a difference
[15:51:31] sheeny: stef1a_: whats in your path?
[15:51:40] sheeny: stef1a_: echo $PATH
[15:52:52] sheeny: stef1a_: ah well its already in there what you need, im not a wizard on paths and stuff but that seems to point to where bundler is
[15:52:58] sheeny: ah gone..
[15:53:09] sheeny: stef1a_: ah well its already in there what you need, im not a wizard on paths and stuff but that seems to point to where bundler is

2013-09-03

[15:06:07] sheeny: D3javu: .. well just do it? I dont see where the question is
[15:06:41] sheeny: D3javu: do you have the albums?
[15:07:25] sheeny: D3javu: how do you mean you dont know how to?
[15:08:25] sheeny: if your using haml..
[15:08:40] sheeny: <%= pic %>
[15:11:55] sheeny: whitsan: you could add "AND post.id != ?", @post.id
[15:13:44] sheeny: D3javu: <%= image_tag(pic["link"]) %> or something along those lines
[15:16:49] sheeny: whitsan: no probs
[15:18:57] sheeny: D3javu: no probs
[15:38:04] sheeny: it always helps talking over the issue
[15:39:49] sheeny: pwz2000_: could simply have a avatar_id on the user which points to an image?
[15:41:27] sheeny: pwz2000_: thats the simplest way i can think, then you just have to simple change that column when they select a new image they want as their avatar