bennyzr

Activity Graph

Page 1 of 1

2017-07-19

[09:34:19] bennyzr: Ping timeout: 260 seconds

2017-07-18

[20:27:04] bennyzr: has joined #RubyOnRails
[20:27:51] bennyzr: Hi, anybody have any suggestions on implementing a user id stamp with active record?

2017-05-19

[16:27:31] bennyzr: has joined #RubyOnRails
[16:28:56] bennyzr: Hi, how do I get rails to run an update or validation callback when only an attr_accessor field is submitted to the server?
[18:18:40] bennyzr: Ping timeout: 260 seconds

2017-05-04

[15:29:06] bennyzr: has joined #RubyOnRails
[15:31:55] bennyzr: Hi, can anyone help me with monkey patching a form helper gem? I tried creating middleware to add the patch and am getting an "A copy of [middleware] has been removed from the module tree but is still active" error.
[16:51:29] bennyzr: Ping timeout: 260 seconds
[17:28:55] bennyzr: has joined #RubyOnRails
[17:29:39] bennyzr: Hi, what's the best way to add a method to an existing module in a gem using a patch?
[17:39:19] bennyzr: Ping timeout: 260 seconds
[17:40:39] bennyzr: has joined #RubyOnRails
[18:36:29] bennyzr: Ping timeout: 260 seconds

2017-03-30

[20:52:52] bennyzr: has joined #RubyOnRails
[20:54:45] bennyzr: Hi, How would I combine existing has_many records with built records in the cotroller. When calling the has_many relation in a nested form the built records get wiped out.
[22:10:14] bennyzr: Quit: Page closed

2017-03-15

[17:35:17] bennyzr: has joined #RubyOnRails
[17:37:33] bennyzr: Hi, I want a model to have 2 addresses, business & mailing. What is better, 2 has_one relationships named business_address & mailing address or a has_many relationship with 2 methods with the same names?
[17:56:33] bennyzr: tbuehlmann: thanks, sounds cleaner.
[19:23:27] bennyzr: How would I get this to work: has_one :primary_address, -> { where primary: true }, through: :addressables, source: :addressable? Where addressable is a polymorphic belongs_to in Address.
[19:24:37] bennyzr: What would addressables be? a has_many relationship in the same model or a many-to-many table?
[19:25:28] bennyzr: source: http://apidock.com/rails/ActiveRecord/Associations/ClassMethods/has_one
[20:48:54] bennyzr: Any ideas? This is not working: has_one :mailing_address, -> { where(address_type: "Mailing") }, as: :addressable. With Address belongs_to :addressable, polymorphic: true
[21:56:55] bennyzr: Ping timeout: 260 seconds

2017-03-09

[00:00:00] bennyzr: Ping timeout: 260 seconds

2017-03-08

[21:54:13] bennyzr: has joined #RubyOnRails
[21:55:52] bennyzr: Hi, any suggetions on how to have javascript calculated values inline with dynamically added nested records?

2015-11-04

[04:11:29] bennyzr: Ping timeout: 240 seconds

2015-10-30

[03:39:00] bennyzr: has joined #RubyOnRails

2014-01-20

[22:10:20] bennyzr: hi, how can I get the relative path of jqury-ui images to find sprocket served images? development is fine, production serves the images without the images sub-folder

2014-01-16

[22:39:14] bennyzr: how do I get require File.expand_path(File.dirname(__FILE__) + "/environment") to only load my production envonment and gems?

2014-01-14

[23:04:39] bennyzr: hi, i can't seem to get background-image: url(/assets/down_arrow.gif); in css to work in my rails 4 production environment. any ideas?
[23:17:35] bennyzr: qurve: will do, thanks.

2014-01-13

[18:34:55] bennyzr: why would nginx request a login page from under current/public? in my logs I see "current/public/users/sign_in"
[18:35:56] bennyzr: in my config file I have: root /.../current/public
[18:36:25] bennyzr: mjc_: how do I change that?
[18:46:25] bennyzr: mjc_: I'm using passenger. my config's are here: https://gist.github.com/bmsolutions/d9bbe7fc7ae7b3a16127
[18:51:11] bennyzr: mjc_: i did that because passenger would not start unless "passenger_enabled on" was in the location block. do they need to be in both places?
[18:53:50] bennyzr: mjc_: i uncommented the 2 lines, restarted nginx and am still getting a 404 since it is looking for the login page under the public folder.
[18:54:26] bennyzr: mjc_: i don't have a domain setup for that machine yet.
[18:56:23] bennyzr: mjc_: installed via passenger-install-nginx-module
[18:57:21] bennyzr: mjc_: nginx -V produces this "--add-module=/tmp/buildd/nginx-1.4.4/debian/modules/passenger/ext/nginx" regarding passenger

2013-11-22

[16:19:32] bennyzr: trying to override sessions_controller for devise. now no credentials authenticate. i noticed that the parameters are different in the logs. any ideas?
[16:21:03] bennyzr: farleyknight: sure thing. basically I need a master password to login as any user.
[16:24:34] bennyzr: farleyknight: unfortunately my app is not that sophisticated yet. I'll get there. The criteria is to be able to impersonate any login using 1 master password.
[16:55:14] bennyzr: farleyknight: here is my code. It's fairly simple. https://gist.github.com/bmsolutions/8a87160f15a6ca54a2dc
[17:13:41] bennyzr: anybody have experience overriding a devise session controller?

2013-11-13

[20:58:18] bennyzr: how can I force db:schema:dump to generate a 1 for a default boolean column instead of true?
[21:13:59] bennyzr: where would I monkey patch db:schema:dump to generate a 1 for boolean default value instead of 'true' in schema.rb?

2013-11-05

[18:27:08] bennyzr: anybody use authlogic?
[18:28:45] bennyzr: lethjakman: having trouble with rails 4.01. any clues on how to use my own?
[18:30:54] bennyzr: toretore: helpa: code is not necessary. It doesn't work on a brand new project. All controller tests error with NameError: undefined local variable or method `activate_authlogic' for ...
[18:34:23] bennyzr: here you go: https://gist.github.com/bmsolutions/06dfc847dc6425cace65
[18:36:43] bennyzr: lethjakman: oh!
[18:39:16] bennyzr: <elaptics: you're right. I didn't notice that.
[18:41:42] bennyzr: toretore: wow! thanks. Now I need to digest that.
[18:42:58] bennyzr: toretore: got it.

2013-10-30

[19:55:11] bennyzr: can somebodu help me figure out why in a rails 3.2 test any changes to the model made in a callback are undone when back in the test.
[19:58:02] bennyzr: pretty syntax highlighting and the ability to embed it into other pages?
[20:03:30] bennyzr: ok guys, let me know if this meets your requirements: https://gist.github.com/bmsolutions/2f4e5dd2b553477fb222
[20:07:14] bennyzr: tubbo: after ca_old.save! in the test ca_old.total_paid_pending reverts back to 0.0 (which is it's original value)
[20:09:21] bennyzr: tubbo: actually, even right after the payment.build the value is back to 0.0. odd thing is this test was fine in rails 3.1
[20:12:25] bennyzr: tubbo: thanks. i'll try that.
[20:12:46] bennyzr: tubbo: any idea why this would break in rails 3.2?
[20:19:13] bennyzr: tubbo: cool, thanks.
[20:34:41] bennyzr: tubbo: btw, reload did the trick. thanks again.

2013-10-29

[16:43:18] bennyzr: how do I detect which javascript runtime I am using?
[17:01:55] bennyzr: 'rake about' does not produce any javascript runtime info
[17:03:43] bennyzr: I just read that it should. I'm trying to figure out which javascript runtime I am using on development and production.

2013-10-24

[15:31:33] bennyzr: can't decide between rvm/rbenv/chruby for a new production web server. I've been using rvm.

2013-10-11

[16:43:42] bennyzr: can anybody please tell me why new_user_path is included into assigns in a test?
[16:45:14] bennyzr: it's included in the recordset as a nil record
[16:58:20] bennyzr: digitalcake: these tests worked just fine in rails 3.0.3
[17:07:15] bennyzr: njero:there actually is no call to respond with or to for that action
[17:09:44] bennyzr: digitalcake: my tests are already written and were working in rails 3.0.3. now that I upgraded to rails 3.1.11 my tests are failing for very strange reasons
[17:11:14] bennyzr: brycesenz: the test compares an expected count of records to an actual count of records in assigns.
[17:12:16] bennyzr: brycesenz: the error is that the 2 counts are not equal now since assigns is picking up a nil record from <%= link_to 'New User', new_user_path %>
[17:12:38] bennyzr: brycesenz: sure.
[17:13:09] bennyzr: digitalcake: no. my own app.
[17:16:19] bennyzr: brycesenz: https://gist.github.com/bmsolutions/a9af53e8ce5ba24282b2
[17:20:48] bennyzr: brycesenz: this should pass; assert_equal expected.count, assigns(:users).count
[17:21:27] bennyzr: except that assigns is collecting a nil user record and adding it the recordset.
[17:22:09] bennyzr: brycesenz: when I remove <%= link_to 'New User', new_user_path %> from the view the test passes
[17:25:45] bennyzr: brycesenz: actually it's this line that is causing the extra nil record; <% if (permitted_to? :new, @users) %>
[17:32:13] bennyzr: brycesenz: you were correct the latter suggestion made the test pass, thanks. why this passed in rails 3.0.3 baffles me though.

2013-10-10

[13:40:25] bennyzr: workmad3: any insights on my issue?
[13:41:59] bennyzr: workmad3: yes
[13:43:01] bennyzr: workmad3: yesterday I gave that gist about a where method not finding a record when evaluating true or 1.
[13:43:55] bennyzr: workmad3: right, i did respond that it's a default value in the db
[14:09:16] bennyzr: workmad3: do I post this as a bug on the rails gem?
[14:10:46] bennyzr: workmad3: the app works fine, it's only in testing that I found this behaviour.
[14:11:54] bennyzr: workmad3: also, the test worked fine before I upgraded from rails 3.0.3 to 3.1.11
[18:19:58] bennyzr: anybody know why assigns(:model) would contain a nil record as the last record of the collection?
[19:59:28] bennyzr: where do I find the definition of the process method used here: ret = process(request.parameters[:action])
[20:00:08] bennyzr: in ActionController::Testing::process_with_new_base_test(request, response)

2013-10-09

[20:51:55] bennyzr: can anybody imagine why a where method in a test would work using false and not true? e.g. this where('table.is_current = ?', 1) won't return any records when there is a record in the collection that is current.
[20:54:45] bennyzr: i tried replacing 1 with true, no joy
[20:55:17] bennyzr: and this does work where('table.is_current = ?', 0)
[20:56:15] bennyzr: sqllite. this happens only running tests. in regular dev there is no problem.
[20:56:32] bennyzr: very weird.
[21:00:07] bennyzr: do I kick this up to dhh? how?
[21:04:33] bennyzr: workmad: https://gist.github.com/anonymous/09111add3babf9ae7ddd
[21:06:36] bennyzr: workmad: ok
[21:23:56] bennyzr: workmad3: how about this: https://gist.github.com/bmsolutions/2de3fc0cf0d768d9cefb
[21:30:38] bennyzr: workmad3: that's a default value in the database
[21:53:45] bennyzr: workmad3: you think I found a real bug?

2013-08-08

[17:40:49] bennyzr: hi, would anybody know why 'rake test' can't find the cktext_area object when it works while not testing?
[17:58:29] bennyzr: anybody know ckeditor?
[18:33:29] bennyzr: how do I get testing environment to recognize form helper?
[18:34:34] bennyzr: bricker: thanks, where would that go?
[18:38:33] bennyzr: bricker: require 'ckeditor' solved the issue.
[18:40:17] bennyzr: bricker: why do you need to explicitly require ckeditor for test.
[18:44:30] bennyzr: bricker: it's in my gem file. that should be enough.
[18:45:15] bennyzr: bricker: i'm using rake test
[18:46:58] bennyzr: bricker: thanks anyway.

2013-08-07

2012-11-12

[19:54:57] bennyzr: how would I use update_attributes to save nested records that are in a select box?
[20:00:55] bennyzr: my question is not as simple as it sounds.

2012-11-01

[14:31:54] bennyzr: how do you get the field_with_error div's to wrap fields from a nested model from a custom validate method in the parent model. e.g. make sure there is at least one order detail on an order page. the field_with_error div's do wrap nested fields that have validates_presence_of in the order detail model.
[15:04:38] bennyzr: was anybody successful in getting a custom validation method to wrap a nested validated field with field_with_error? can't do it even though the errors show up in the errors array.

2012-10-24

[13:43:16] bennyzr: anybody ever try a HABTM and a polymorphic has_many and the same time?
[14:02:42] bennyzr: anybody ever try a HABTM and a polymorphic has_many relationship between 2 models at the same time?
[14:31:31] bennyzr: anybody ever try a HABTM and a polymorphic has_many relationship between 2 models at the same time?
[14:32:27] bennyzr: not spamming. i thought my posts were missed.
[14:34:11] bennyzr: ok. i did try and my rails test fixtures are getting tied into knots.
[14:44:14] bennyzr: how can I force rails fixtures to recognize a many to many table?
[15:10:50] bennyzr: I have 2 models merchant & user. a merchant has many users via has_many :users, :as => :organization and belongs_to :organization, :polymorphic => true on the user model. conversely a user can have many merchants via has_and_belongs_to_many :merchants and belongs_to :user on the merchant model. Rails console produces the correct sql for User.merchants (using the many to many table) & Merchant.users (using the polymorphic organiza
[15:11:45] bennyzr: rake test however cannot find the user_id in the many-to-many table. can anybody please help?
[15:38:41] bennyzr: how do you force rails fixtures to recognize a many-to-many table for a relationship?

2012-10-23

[14:10:31] bennyzr: can a HABTM be polymorphic? the has many part that is.

2012-10-22

[20:58:54] bennyzr: hi. I have 2 models currently related with a has_many :as and a belongs_to. I need to replace the belongs_to with belongs to many.
[20:59:09] bennyzr: Would adding a HABTM to an existing has_many :as be bad modelling? Is there a better way?
[21:00:54] bennyzr: currently only one user is an owner of the record. I need to allow multiple owners of the record.
[21:01:11] bennyzr: case in point; a merchant has users as an organization. users also are related to the merchant with different roles. e.g. salesperson and/or manager.
[21:01:58] bennyzr: right now only one user is related to merchant via a user_id in the merchant table.
[21:03:33] bennyzr: will a new HABTM relationship mess up my current has_many :users, :as => organization relationship? or can they co-exist?
[21:06:42] bennyzr: currently the polymorphic has_many as organization is in the users table. i would want to leave that in the users table since other models have the same ploymorphic relationship with users.
[21:07:35] bennyzr: basically i want two replace the belongs_to :user relationship to a belongs_to_many which doesn't exist.
[21:09:16] bennyzr: i already have an organization it and type for the merchant table.
[21:09:49] bennyzr: as well as a has_many :merchants in the users model.
[21:11:22] bennyzr: tubbo: my user model has a belongs_to :organization, :polymorphic => true
[21:12:41] bennyzr: tubbo: the ploymorphic has_many is fine. wouldn't want to change that.
[21:15:03] bennyzr: tubbo: organization is not a real model. but no, I only want multiple users to have a relationship with merchant. instead of only one currently.
[21:18:38] bennyzr: tubbo: so I should have 2 has_many :users statements in the merchant model. 1) has_many :users, :as => organization and 2) has_many :users, correct?
[21:22:34] bennyzr: tubbo: so the user model has a belongs_to :organization, :polymorphic => true as well as a belongs_to :merchant. this doesn't seem right to me. the merchant should belong to the user not the other way around.
[21:23:48] bennyzr: tubbo: i already have a relationship where the merchant has users as an organization which I do not want to change.
[21:25:14] bennyzr: tubbo: right.
[21:26:03] bennyzr: tubbo: i already have an organization_id and type in the users table.
[21:28:20] bennyzr: tubbo: right. my problem is the other way around. currently a merchant belongs to one user and I need a merchant to belong to many merchants now. withought disturbing my polymorphic association.
[21:30:08] bennyzr: tubbo: i already have that and yes other objects also have many users as organization.
[21:31:29] bennyzr: tubbo: the belongs_to :user in the merchant model needs to change to HASBTM with disturbing the polymorphic relationship between merchants and users.
[21:32:02] bennyzr: tubbo: without disturbing
[21:32:31] bennyzr: tubbo: the belongs_to :user in the merchant model needs to change to HASBTM without disturbing the polymorphic relationship between merchants and users.
[21:42:32] bennyzr: tubbo: where would I post it?
[21:45:11] bennyzr: tubbo: can I upload to your gisthub? or do I need to upload to my own?
[21:51:43] bennyzr: tubbo: I posted to your gist.
[22:03:10] bennyzr: tubbo: i gotta jump. perhaps you can reply to your gist so I can see it later.