Displaying 20 results from an estimated 200000 matches similar to: "increment!(attribute) no worky"
2006 Mar 22
1
updating multiple attributes
I have a store administration tool I''m trying to build.
One view is an item view. Each item can have many attributes.
Example:
item: bike
item_id: 2333
attribute: id: 3 #auto-increment
item_id: 2333 #primary key
attribute_type: wheels #a type of attribute
attribute_order: 1 #the order it
2006 Mar 11
2
ActiveRecord increment confusion
Part of my application counts the number of times a link was clicked.
The Link.click function should increment the @link.clicks attribute.
I assumed
def click
@link = Link.find(params[:id])
if @link.increment(''clicks'')
redirect_to @link.url
else
flash[:error] = ''Could not update clicks''
redirect_to :action =>
2006 Mar 10
0
Overriding save breaks increment!/decrement!
Is overriding ActiveRecord#save verboten? Doing this causes increment!
and decrement! to break (1 for 0 argument error):
def save
create_or_update
# also tried ''super''
# do stuff
end
Joe
--
Posted via http://www.ruby-forum.com/.
2008 Jun 04
2
Mock with an attributes that has state
I''m developing a rails application. I have an Order model that has_many
OrderItems.
I mocked the OrderItem model in my Order specs using mock_model. I thought
I should focus my specs on each model and always mock associated models.
In my Order model I need a way to merge OrderItems which have the same cost
and same product_id. That I can spec.
The other thing this merge helper
2008 Feb 13
5
Example controller spec no worky?
I''m trying to spec a dead simple "show non-existent record should render
404" case, but it seems the RecordNotFound exception is making it
impossible for some reason.
#controller
def show
@event = Event.find(params[:id])
end
#spec - pretty much straight from the rspec site
before do
Event.stub!(:find)
get :show, :id => ''broken''
end
#
2006 Feb 14
0
Best practices for handling associations in ctrlrs/views
Forgive me if this topic has come up before. I''m new to Rails (from a
Java background, with a good deal of Perl as well.) I''m very much
attracted to the idea of having an integrated MVC stack, and from what I
see, Rails is "the right thing."
To set up my question, here''s some background. In an app I am building,
there are three models:
an item has many
2016 Mar 25
1
attribute of intrinsic function
Thanks for your reply, Philip.
You are right, when I use LLVM-3.8, the 'argmemonly' shows up. Previously,
I use LLVM-3.7.
I think idempotent is what I want. Can you tell me how to add idempotent
attribute to the function? Thanks.
Regards,
Xiangyang
2016-03-24 14:30 GMT-07:00 Philip Reames <listmail at philipreames.com>:
>
>
> On 03/24/2016 12:45 PM, Xiangyang Guo via
2016 Mar 24
0
attribute of intrinsic function
On 03/24/2016 12:45 PM, Xiangyang Guo via llvm-dev wrote:
> Hi,
>
> When I define an intrinsic function with memory write permission, my
> assumption is that we can either attach [IntrReadWriteArgMem] or [] to
> the intrinsic function. Based on the comment of the source code ,
> "IntrReadWriteArgMem - This intrinsic reads and writes only from
> memory that one of its
2004 Oct 25
1
Rails 0.8: Just shy of 100 additions, changes, tweaks, and fixes!
It''s been fifty days since our last confession, so it''s no wonder that
this outpouring is by far the biggest yet in Rails history. It''s
absolutely packed with goodies ranging from a whole new framework for
sending email to the smallest new alias for an existing method. In
total we''re just shy of 100 additions, changes, tweaks, and fixes.
This is also
2016 Aug 08
0
UNIX attribute UID no longer increments with RSAT
On Mon, 8 Aug 2016 08:52:39 -0400
"lingpanda101 at gmail.com" <lingpanda101 at gmail.com> wrote:
> Hello,
>
> I'm using rfc2307 to enable Unix attributes on my DC's. Recently
> when adding a user and attempting to add a UID with the RSAT, I
> receiving the following error.
>
> 'Duplicate UID. Assign a uniqueUID.'
>
> How do I
2020 Oct 15
0
[PATCH v4 09/10] dma-buf-map: Add memcpy and pointer-increment interfaces
To do framebuffer updates, one needs memcpy from system memory and a
pointer-increment function. Add both interfaces with documentation.
Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
---
include/linux/dma-buf-map.h | 72 +++++++++++++++++++++++++++++++------
1 file changed, 62 insertions(+), 10 deletions(-)
diff --git a/include/linux/dma-buf-map.h b/include/linux/dma-buf-map.h
2005 May 19
3
GUIDs vs. Auto-Increment id's
I know this thread has been discussed before, but I have run into this
problem and would like to re-open it...
I have come to a point in my project where I need to provide an
import/export feature for Active Records. Since a user could export
off one system and import onto another auto-increment integers will
not work (collisions on ids due to lack of uniquness).
Listed below is an initial list
2020 Oct 28
0
[PATCH v6 09/10] dma-buf-map: Add memcpy and pointer-increment interfaces
To do framebuffer updates, one needs memcpy from system memory and a
pointer-increment function. Add both interfaces with documentation.
v5:
* include <linux/string.h> to build on sparc64 (Sam)
Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
Reviewed-by: Sam Ravnborg <sam at ravnborg.org>
Tested-by: Sam Ravnborg <sam at ravnborg.org>
---
2020 Oct 20
0
[PATCH v5 09/10] dma-buf-map: Add memcpy and pointer-increment interfaces
To do framebuffer updates, one needs memcpy from system memory and a
pointer-increment function. Add both interfaces with documentation.
v5:
* include <linux/string.h> to build on sparc64 (Sam)
Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
Reviewed-by: Sam Ravnborg <sam at ravnborg.org>
Tested-by: Sam Ravnborg <sam at ravnborg.org>
---
2006 Jun 23
0
Overriding a file_column attribute in model
I have a user model subclassed into Employees and Managers using STI. I
am using FileColumn to manage images, in this case logos. If an Employee
doesn''t have a logo of its own, I want my app to use the Manager''s logo
in views.
I did the following in models/users.rb:
-------
class User < ActiveRecord::Base
file_column :logo
end
class Employee < User
belongs_to
2006 Mar 13
1
has_many.collection<<obj doesn''t set attributes?
I tried:
@item.stuff<<thing
and in thing I have:
def stuff_id=(value)
# remember old stuff_id cuz Rails has lousy trigger equivalent
logger.debug ''set stuff_id called''
end
And apparently stuff_id doesn''t get called, but the fk is changed
directly in the database? I''m about to abandon trying to do trigger
related stuff in Rails and go back to
2006 Sep 26
0
Find Returning String Instead of Integer?
Any ideas on why this is? The quantity field in mysql is INT, but I get
back a string? This is preventing me from using the increment method.
>> @cart = Cart.new
=> #<Cart:0x2730f40 @new_record=true, @attributes={}>
>> @cart.items << Item.find(:first)
=> [#<Item:0x272d6ec @attributes={"vendor_id"=>"1",
2012 Jun 19
1
weird --no 'dimnames' attribute for array-- error for R lordif package
Hi All,
? I am trying to use the lordif package in R and can't figure out the reason for the above error when I try to run the calctheta() function.
##################
# read data using foreign package - must be Stata 11 or earlier
racedata<- read.dta("race.dta")???
# item responses
resp.data<-racedata[,-c(1:2)]
# grouping variable is in the second column
2006 Jun 11
4
[Question} how best to use attribute driven db with Rails
I designed out a mostly attribute driven database. Originally i was
going to use PHP, but have now decided to use RoR. Being able to use the
built in OR functionality would be nice, but I am not sure how well it
melds with attribute dbs.
If anyone can give me some pointers, I would really appreciate it
(especially since this is my first endeavor and on an important project
as well).
2006 Feb 16
2
Autocompleter question
Hey all,
When using the Ajax.autocompleter, how would I configure it so that the
user is searching based on an entry''s name, but once they select an entry, I
record the ID?
I have the user entering a person''s name in a text box to make it easier
to find contacts in a large database. I know that I can display content
that doesn''t end up in the textbox by using