Anton Katunin
Anton Katunin
I think that might be useful to have, in the meantime it's possible with a simple module ```ruby module EnforceFilters extend ActiveSupport::Concern MissingFilterError = Class.new(StandardError) included do class_attribute :enforce_filters end...
@ngan My hesitation to use Rails Strong Params is that it requires duplication of all form's (interaction) inputs. With interaction it's pretty much clear what it needs and what params...
@blackst0ne I've wrote the extension which integrates strong params. https://github.com/antulik/active_interaction-extras#strongparams We are using it in production, but I would probably change the interface if I was to write it today.
A temporary patch ```ruby # config/initializers/devise_token_auth.rb # https://github.com/lynndylanhurley/devise_token_auth/issues/1514 module DeviseTokenAuthCSRFPatch def handle_unverified_request(*) super.tap do @resource = nil end end end DeviseTokenAuth::Concerns::SetUserByToken.include DeviseTokenAuthCSRFPatch ```
Faced the same problem. This is what I've found. The performance bottleneck is at `Dir#[]` method. WAT? Exactly what I thought. gem uses `render_to_string` method. If `layout: true` it renders...
Continued... The question is why does it do that. Rails searches for templates with specific format first and if nothing is found then all formats are checked. In my case...
did some investigation with this example ``` ruby class TweetMash < Hashie::Mash include Hashie::Extensions::Coercion coerce_value Hash, Hashie::Mash end t = TweetMash.new(:user => {:email => '[email protected]'}) ``` first `Mash#convert_value` converts new...
A workaround ```ruby User.each_row do |attributes| user = User.instantiate attributes # do stuff end ``` Note: it only works for simple queries where returned columns map directly to model columns
Looking at rails code, rails defaults column types instead of relying on postgres. https://github.com/rails/rails/blob/23019c3969906b032235a644eb73768809e289a6/activerecord/lib/active_record/querying.rb#L50-L52 while `postgresql_cursor` gem forces all column types from postgres https://github.com/afair/postgresql_cursor/blob/6123a23d5c338ae27b28c9292ec7d461db22d5f5/lib/postgresql_cursor/cursor.rb#L229-L249
Had a quick dig, and can confirm it by just looking at gem's code. > the gem doesn't reset the value after the cursor is done, so it's potentially poisoning...